ImageMagick should assume OpenEXR images are linear

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
diego.nehab
Posts: 1
Joined: 2012-05-01T03:48:40-07:00
Authentication code: 13

ImageMagick should assume OpenEXR images are linear

Post by diego.nehab »

Dear ImageMagick developers,

I use ImageMagick everyday, and I can't express how grateful I am for the work you put into this wonderful library.

I have recently started working with OpenEXR images, and I have noticed that the "identify" command lists gamma as 0.45455, even though the documentation for OpenEXR states that values are stored as linear intensities. There does not seem to be a standard attribute for specifying a different gamma value in OpenEXR images, and I believe ImageMagick should honor the specification in assuming a gamma value of 1, rather than assuming 0.45455.

Incidentally, running

convert a.exr -set gamma 1.0 b.exr

has no effect in an OpenEXR file, as "identify" continues to report a gamma 0.45455 for b.exr. Looking at the OpenEXR headers on b.exr does not indicate the presence of any gamma metadata. There really seems to be no mechanism in place for gamma information.

Using the "display" utility to inspect an OpenEXR image naturally shows incorrect results. Interestingly, although running

convert a.exr gamma 2.2 c.exr && display c.exr

shows the correct results, running

display -gamma 2.2 a.exr

does not. By trial and error, I found that the value of 1.5 produces good results with "display" (I have no idea why).

Any way, is this just a misunderstanding on my part?

Kind regards,
Diego
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick should assume OpenEXR images are linear

Post by magick »

We can reproduce the problem you posted and have a patch. Look for it in the next point release of ImageMagick. Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: ImageMagick should assume OpenEXR images are linear

Post by anthony »

If that is the case then OpenEXR images should also have colorspace RGB and not sRGB!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick should assume OpenEXR images are linear

Post by fmw42 »

I see that this has been changed in IM 6.7.6.9

I checked the verbose info for an exr image I have been using in the past for my tonemapping and the results of my scripts have changed. I was just wondering what the rendering intent should be for exr. I see it is set to perceptual and am wondering if this may also be one contributing factor to my script differences between IM 6.7.5.10 and 6.7.6.9. Also in the old version, chromaticity values are not set, but they are in the current im version.

see
viewtopic.php?f=3&t=20983
Post Reply