negative values in EXR file problem

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
willanie
Posts: 4
Joined: 2017-06-01T09:47:07-07:00
Authentication code: 1151

negative values in EXR file problem

Post by willanie »

Im using Using ImageMagick-7.0.5-3-Q16-HDRI-x64
I have a 16bit exr image that contains negative values.
Im using montage to create a contact sheet of exr images with magick.exe and I notice that the image with negative values is resulting in a blank thumbnail.
Is there a workaround?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: negative values in EXR file problem

Post by fmw42 »

What is your exact command line and platform/OS? (I presume Windows from your magick.exe)
willanie
Posts: 4
Joined: 2017-06-01T09:47:07-07:00
Authentication code: 1151

Re: negative values in EXR file problem

Post by willanie »

Im on windows7.
I just tried imdisplay.exe as well and it produces a blank image.
Is there some way to attach an file on this forum?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: negative values in EXR file problem

Post by snibgo »

You can upload image files to somewhere like dropbox.com, and paste the URLs here.

I could be wrong, but I thought that in EXR RGB format, zero is black, so negative values are blacker than black. Though valid, this is often rounded to black.

If you don't want negative values to be black, what do you want?
snibgo's IM pages: im.snibgo.com
willanie
Posts: 4
Joined: 2017-06-01T09:47:07-07:00
Authentication code: 1151

Re: negative values in EXR file problem

Post by willanie »

Its not that I get black ... its broken when this exr file is used in a process that outputs an 8bit integer result.
If I try to imdisplay an exr which has some negative values it show a totally transparent result ... nothing shows even in the areas where the values are positive.
Also when converting the same exr(which is actually a normalmap with value ranges from -1.0 to 1.0) to a png or jpg I get an empty output.
I would expect that the exr with negative float values would result in black in those areas when exported to a 8bit integer file format not an empty file.
The strange thing is I can process and export to a new exr file and everything works fine.

here is the link to the exr file

https://drive.google.com/open?id=0B4Cuh ... 3F4ZHQ2Q3M
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: negative values in EXR file problem

Post by snibgo »

An integer version of IM, v6.9.5-3, says the RGB value range from 0.0 to 100%, but all pixels have zero alpha (fully transparent). To remove transparency, use "-alpha off", eg:

Code: Select all

magick camera1_NORMAL.0001_negvals.exr -alpha off out.png
The image, out.png, seems reasonable.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: negative values in EXR file problem

Post by fmw42 »

It may be than montage does not work well in HDRI mode for images with values outside the normal range, such as negative values. Try using convert in IM 6 or magick in IM 7 to simple convert your image to the format you want. Does that work? Check your same process for montage in IM 6? Does that work? ImageMagick convert/magick should be able to handle negative values and scale them to some reasonable range or clip them if you are using HDRI mode, which you said you were in your original post.
willanie
Posts: 4
Joined: 2017-06-01T09:47:07-07:00
Authentication code: 1151

Re: negative values in EXR file problem

Post by willanie »

great suggestions snibgo and fmw42 ...
-alpha Opaque worked
thanks for solving this for me
Post Reply