Rendering intent in mogrify / identify

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
rseeker
Posts: 6
Joined: 2010-07-31T17:45:27-07:00
Authentication code: 8675308

Rendering intent in mogrify / identify

Post 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.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Rendering intent in mogrify / identify

Post 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".
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Rendering intent in mogrify / identify

Post by magick »

The problem you reported will be fixed in ImageMagick 6.6.3-3 Beta within a day or two. Thanks.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Rendering intent in mogrify / identify

Post by Drarakel »

Works good. Thank you!
Post Reply