This project has moved and is read-only. For the latest updates, please go here.

MagickImage Extent adds black line at top of image

Oct 15, 2014 at 1:48 AM
I am doing the following to resize an image. When doing this, it adds a black like at the top of the image, even though the fill color is white.
        MagickImage from = new MagickImage(strTempFile);
        from.Extent(MaxWidth, MaxHeight, Gravity.Center, new MagickColor(Color.White));
        if (strNewExt.ToLower() == ".tiff"
        || strNewExt.ToLower() == ".tif")
        {
            from.RemoveProfile("tiff:37724");
        }
        from.Write(strFileName);
        from.Dispose();
https://www.boomerangdm.com/Before.tif
https://www.boomerangdm.com/After.tif
Oct 15, 2014 at 5:33 PM
Edited Oct 16, 2014 at 5:43 AM
This seems to be a CMYK bug in ImageMagick7. If you change the ColorSpace of your image to ColorSpace.RGB before you extent the image it will set the correct color. If you need to keep CMYK you will have to wait for the next release that will include a fix for this.
Oct 15, 2014 at 7:11 PM
Your idea worked perfectly! It does look like a bug in ImageMagick. Thanks! I no longer have the black lines!