Page 1 of 1

Multiplying 2 HDR Q32 image result in Q8 output

Posted: 2018-10-28T10:59:17-07:00
by f2b
Hi, i use IM Q16 HDRI

when i multiply two HDR (each 32bit/channel) it results in a 8bit image... It's saved in 32bit but pixelx values no more exceed 1.0 :(. Bright values are all clamped to 1.0

here is my command

magick -gravity center image1.hdr image2.hdr -compose Multiply -composite -define quantum:format=floating-point -depth 32 result.hdr

Thanks for you help

Re: Multiplying 2 HDR Q32 image result in Q8 output

Posted: 2018-10-28T11:09:33-07:00
by snibgo
For compositions, values are first normalized to nominal 0.0 to 1.0, by dividing by QuantumRange, then un-normalized afterwards. For example:

Code: Select all

f:\web\im>%IMG7%magick xc:gray(50%) xc:gray(25%) -compose Multiply -composite txt:

# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (8191.88,8191.88,8191.88)  #200020002000  srgb(12.5%,12.5%,12.5%)
This ensures the result is the same, whatever the Q-number.

Does that explain the problem?

Re: Multiplying 2 HDR Q32 image result in Q8 output

Posted: 2018-10-28T11:13:55-07:00
by f2b
if i understand you, you are saying that it shoud works, but i can't see what's wrong with my command :/

Re: Multiplying 2 HDR Q32 image result in Q8 output

Posted: 2018-10-28T11:27:32-07:00
by snibgo
"-composite" will clamp at 0% and 100% unless you include "-define compose:clamp=off".

Re: Multiplying 2 HDR Q32 image result in Q8 output

Posted: 2018-10-28T11:35:10-07:00
by f2b
oh yeah, it works! You are the boss! ;)

thank you very much :)