Quantcast
Channel: magick Discussions Rss Feed
Viewing all 3693 articles
Browse latest View live

New Post: DPI

$
0
0
Hi

How do I change the DPI for an existing image? I want to set it to 96.

I guess this is the Density property on the image but I've not been able to get it to work as required yet.

Thanks

Russell

New Post: DPI

$
0
0
Can you provide me with a code sample and an example image?

New Post: Getting pixel color

$
0
0
I have been trying to get color of a pixel, and have used the examples found in the forum. But it seems like using the methods is not giving the right result for the alpha channel.

The files i am having problems with is this file returns 255, where another file returns 0 for the alpha channel

The file that return 0 is not even transparent - is there a way to better determine color and transparency.

This is my code.

Pixel pixel = image.GetReadOnlyPixels().GetPixel(x, y);
red = pixel.GetChannel(0);
green = pixel.GetChannel(1);
blue = pixel.GetChannel(2);
alpha = pixel.GetChannel(3);

New Post: Getting pixel color

New Post: Getting pixel color

$
0
0
I have implemented the inversion this way:

alpha = 255 - pixel.GetChannel(3);

and it works perfect now :-)

Is there a way to identify what each channel is reprecenting Red/Green/Blue/Alpha/Cyan and so on?

New Post: Memory leak when appending *.tif files

$
0
0
I want to combine 2 *.tif files into 1 side by side image so I made it like this:
private void button1_Click(object sender, EventArgs e)
        {
            using (MagickImageCollection images = new MagickImageCollection())
            {
                MagickImage first = new MagickImage("11.tif");
                first.Resize(1169, 1653);
                images.Add(first);

                MagickImage second = new MagickImage("22.tif");
                second.Resize(1169, 1653);
                images.Add(second);
                
                using (MagickImage result = images.AppendHorizontally())
                {                    
                    result.Write("output.tiff");                   
                }
            }

        }
The combined file is successfully created but may be it causes memory leak. I opened task manager for observing, everytime I clicked the button, the application occupied more and more memory.

I'm using Magick.NET-6.8.6.301-Q8-x86-net40-client
.NET framework 4.5

The source images("11.tif", "22.tif") attributes as follow:
Dimension: 1653x2338
Horizontal resolution: 200 dpi
Vertical resolution: 200 dpi
Bitdepth: 1
Compression: CCITT T.6
Resolution unit: 2

Thanks for any help!

New Post: Getting pixel color

$
0
0
I did some research and the value is correct for ImageMagick 6. It seems that the inversion will happen in ImageMagick 7. I will keep it this way for now. You can identify each channel by the Format of the image.
using(PixelCollection pixels = image.GetReadOnlyPixels())
{
  // RGBA:
  Pixel pixel = GetPixel(x, y);
  red = pixel.GetChannel(0);
  green = pixel.GetChannel(1);
  blue = pixel.GetChannel(2);
  alpha = pixel.GetChannel(3);

  // CMYK:
  Pixel pixel = GetPixel(x, y);
  cyan = pixel.GetChannel(0);
  magenta = pixel.GetChannel(1);
  yellow = pixel.GetChannel(2);
  key = pixel.GetChannel(3);

  // Gray: (uses 4 channels in IM6 this will change in IM7)
  Pixel pixel = GetPixel(x, y);
  gray = pixel.GetChannel(0);
}

New Post: assembly reference not sticking

$
0
0
I'm digging the embedded assemblies. I'm having a compilation problem though now in an ASP.NET web site project. Do you think I need to convert to a web project? When I reference the assembly (x64), the reference doesn't "stick" and I end up with a build error:
The type or namespace name 'ImageMagick' could not be found (are you missing a using directive or an assembly reference?)
However it runs just fine. It's just a compilation time issue that I need to get past for my builds to succeed. Any help would be appreciated. Thanks.

New Post: Memory leak when appending *.tif files

$
0
0
I can reproduce this and the problem is not specifically for .tiff files it also happens with other formats. I will create a work item to fix this bug in the MagickImageCollection.

New Post: Memory leak when appending *.tif files

$
0
0
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.

New Post: assembly reference not sticking

$
0
0
You probably have to add the assembly to the web.config You should edit your web.config and add the folllowing:
<system.web><compilation><assemblies><addassembly="Magick.NET-x64"/></assemblies></compilation></system.web>

New Post: Magick.NET and Mono

$
0
0
So, does Magick.NET works on Mono?

1) yes, out of the box
2) must be recompiled to use with Mono
3) no, but Mono support is planned
4) no, noway!
5) other?

New Post: Magick.NET and Mono

$
0
0
no idea?

ImageMagick is cross platform, why would you want to use Magick.NET with Mono?

New Post: Geometry units

$
0
0
I would like to express geometry in units other than pixels, but can't figure out how. I'm building a scanner application where it would be convenient to size the image in inches or centimeters.
thanks,
Jon

New Post: Geometry units

$
0
0
You can only express geometry in pixels, you will have to do the calculations yourself.

New Post: Geometry units

$
0
0
Rats. Anyway, thanks for a great dll - makes life so much easier.

New Post: Drawing Italic / Different font text

$
0
0
This doesn't seem to work to draw italic, bold Tahoma text:
using (var img = new MagickImage(img.Filename))
{
    // Draw text
    working.StrokeColor = new MagickColor("#FFFFFF");
    working.FillColor = working.StrokeColor;
    working.Font = "Tahoma";
    working.FontPointsize = 24f;

    using (var piFont = new DrawableFont("Tahoma", FontStyleType.Italic, FontWeight.Weight700, FontStretch.Normal))
    {
        working.Draw(piFont);               
        var metrics = working.FontTypeMetrics("Why hello there!");
        using (var piText = new DrawableText(10, working.Height - metrics.TextHeight - 10, "Why hello there!"))
        {
            working.Draw(piText);
        }
    }

}
Any suggestions?

New Post: Drawing Italic / Different font text

$
0
0
If you want to do multiple draw operations you should use the overload of Draw that accepts an IEnumerable<DrawableBase>. I posted an example here: https://magick.codeplex.com/discussions/445822. I will change the method signature of Draw(Drawable) to Draw(params Drawable) to make this more obvious.

New Post: Magick.NET and Mono

$
0
0
I see, the problem is in managed C++.

I want to use Magick.NET with Mono because Mono is cross-platform too.

Now for a simple cross-platform solution I need to create some sort of an object wrapper around imagemagick executable, but with a plenty of imagemagick command line options it is hard to create more or less complete API.

New Post: Magick.NET and Mono

$
0
0
I might create a build for Mono in the future when I have too much spare time on my hands. I don't know if it is possible but I will give it a try later.
Viewing all 3693 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>