Page 1 of 1

Rendering intent in mogrify / identify

Posted: 2010-08-03T05:03:10-07:00
by rseeker
As initially described here:

viewtopic.php?p=61803

there may be a bug in either assigned or reported rendering intent with PNG files using 'mogrify -intent someintent somefile.png' followed by 'identify -verbose somefile.png'.

The error is exhibited by assigning some rendering intent with mogrify. After this, identify reports a value for rendering intent which matches the value assigned with mogrify, but the program TweakPNG reports a different value.

I take this as a bug in either TweakPNG or ImageMagick. Drarakel suggested I report it here, so here you go.

http://entropymine.com/jason/tweakpng/

Thanks.

Re: Rendering intent in mogrify / identify

Posted: 2010-08-03T23:09:48-07:00
by Drarakel
From 'profile.h' (IM v6.6.3-2):

Code: Select all

typedef enum
{
  UndefinedIntent,
  SaturationIntent,
  PerceptualIntent,
  AbsoluteIntent,
  RelativeIntent
} RenderingIntent;
And ImageMagick reads the intent from PNG by reading the original number and adding 1 - and sets it by subtracting 1 from the internal number (png.c).
But the order in the PNG specs is like this:
http://www.libpng.org/pub/png/spec/1.2/ ... tml#C.sRGB
The following values are defined for the rendering intent:

0: Perceptual
1: Relative colorimetric
2: Saturation
3: Absolute colorimetric
ImageMagick itself does fine with its own order of the intents. But the numbers are not compliant to the PNG specs, and so the other tools report completely different intents.
Example: The intent in ImageMagick is set to "Relative". This is number 4 in the above enum. IM writes it as 3 into the PNG file (4-1). But 3 is "Absolute". So, other tools will report this as "Absolute".

Re: Rendering intent in mogrify / identify

Posted: 2010-08-04T07:50:16-07:00
by magick
The problem you reported will be fixed in ImageMagick 6.6.3-3 Beta within a day or two. Thanks.

Re: Rendering intent in mogrify / identify

Posted: 2010-08-08T14:50:03-07:00
by Drarakel
Works good. Thank you!