Hi Folks
I'm struggling through an effort to use ImageMagick to convert a videogame lightmap from hdr EXR to RGBM encoded 8888.
If I print the EXR file to text:, I see many pixels that report (-100%, -100%, -100%) #00000000 ....
I expect all the values in this lightmap are positive, and certainly not flagged -100%.
Does this ring any bells?
I have been clamping to zero for now but I am suspicious that something is more wrong than that.
Thanks
T Mouton
Unexpected Negative Values from EXR
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Unexpected Negative Values from EXR
EXR, I believe, can have negative values like any other HDRI image, especially if you are using full 32-bit EXR. The 16-bit half EXR may or may not allow negative values. But both allow fractional values. I was not aware that IM supported anything but the half format. Perhaps that is a new enhancement. You will need IM compiled with HDRI enabled to get full use out of EXR.
I will leave a format reply to the IM developers to correct me if I am wrong. Perhaps it is a bug.
Also it is always a good idea to provide your version of IM and platform. The easiest thing is to run
convert -version
and post the results along with your platform.
I will leave a format reply to the IM developers to correct me if I am wrong. Perhaps it is a bug.
Also it is always a good idea to provide your version of IM and platform. The easiest thing is to run
convert -version
and post the results along with your platform.
Re: Unexpected Negative Values from EXR
ImageMagick 6.8.9-8 Q16 x86_64 2015-01-17 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC HDRI Modules
Delegates: bzlib freetype jng jpeg ltdl lzma openexr png xml zlib
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC HDRI Modules
Delegates: bzlib freetype jng jpeg ltdl lzma openexr png xml zlib
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Unexpected Negative Values from EXR
You did not report your platform. Nevertheless, I would recommend checking the EXR documentation about whether negative values are to be expected. Sorry I do not know much about lightmaps. How was this converted to EXR format? Perhaps there is a fault there? It also could be a bug in IM.
I checked 4 EXR images that I had. Three had no negative values, but one did. So as I said earlier, EXR can have negative values. You may or may not want that and may need to clamp as you did if you do not want that. But clamping will clamp at the Q level (assuming it is Q16 or 16-bit range) as well as at 0. So that may limit your dynamic range.
I checked 4 EXR images that I had. Three had no negative values, but one did. So as I said earlier, EXR can have negative values. You may or may not want that and may need to clamp as you did if you do not want that. But clamping will clamp at the Q level (assuming it is Q16 or 16-bit range) as well as at 0. So that may limit your dynamic range.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Unexpected Negative Values from EXR
"-auto-level" is also possible, and seems to work as I would hope with HDRI values outside 0 to 100%.
snibgo's IM pages: im.snibgo.com