Issues with -clamp and -depth in HDR

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

Re: Issues with -clamp and -depth in HDR

Post by magick »

We can reproduce the problem you posted and will have a patch in ImageMagick 6.8.5-1 Beta available within a few days. Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Issues with -clamp and -depth in HDR

Post by anthony »

pipe wrote:Yeah, what the patch does is simply to test for negative numbers just before applying the operation that would cause negative numbers to break. The level operation is left intact.

This is however not the case with the -gamma operator, which works through a lookup-table, which has the effect of both quantizing any HDR floats to 16 bits, and also clipping them to 0.0 - 1.0.
IMv7 version of -gamma for the "magick" command (and the "convert" backward compitiblity command) was changed to call a mathematical evaluate pow rather than the cached gamma version. It probably should be backported to IMv6.

That version also has a +gamma that 'undoes' the gamma requested.

If you want to set the gamma metadata of an image (uncommon) you can use -set gamma though I think the write operation now overrides that meta-data value.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
pipe
Posts: 28
Joined: 2013-04-09T08:32:37-07:00
Authentication code: 6789

Re: Issues with -clamp and -depth in HDR

Post by pipe »

Maybe I should start using IM7, I think there are a lot of problems with negative values in HDRI in IM6 that would still be in IM7, and I would like to help finding them. Most image processing algorithms that I have read about doesn't need to handle negative image values, so there may be a lot of issues that are normally nearly invisible, and some of these may be possible to solve without clamping.
Post Reply