I've compiled imagemagick support for HEIC and i've noticed that the display command displays my pictures with the wrong colorspace. After having looking into the code i noticed that the readimage function returned images using the YCbCr colorspace and that the display command tried to display it without changing the colorspace to sRGB.
Here is proposal patch for fixing this issue (imagemagick 7) :
diff --git a/MagickWand/display.c b/MagickWand/display.c
index a63ec7a51..eca8c047d 100644
--- a/MagickWand/display.c
+++ b/MagickWand/display.c
@@ -487,6 +487,11 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
(void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
images=ReadImage(image_info,exception);
CatchException(exception);
+ if (images->colorspace != sRGBColorspace)
+ {
+ (void) TransformImageColorspace(images,sRGBColorspace,exception);
+ CatchException(exception);
+ }
status&=(images != (Image *) NULL) &&
(exception->severity < ErrorException);
if (images == (Image *) NULL)
[PATCH] display command does'nt change colorspace to sRGB if needed
Re: [PATCH] display command does'nt change colorspace to sRGB if needed
This is expected behavior. Instead try this command:
Code: Select all
display -colorspace sRGB image.heic
Re: [PATCH] display command does'nt change colorspace to sRGB if needed
Yes, this works but my feeling is it would be nice to set it as a default behaviour. If you are, like me, a new user, you would probably expect the display command to work "out of the box" without figuring out the settings to display it correctly.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: [PATCH] display command does'nt change colorspace to sRGB if needed
But is your screen sRGB? How does IM's Display know what colorspace your screen needs?
snibgo's IM pages: im.snibgo.com
Re: [PATCH] display command does'nt change colorspace to sRGB if needed
ImageMagick has a hands-off philosophy. We assume the user knows what they are doing so we don't touch the image attributes, including the colorspace, without an explicit command-line option.