I am using IM 7.0.7.21 Q16 Mac OSX Sierra. I am trying to do a particular computation that requires HDRI to permit negative values. I get one result saving separate steps to mpc and another result when trying to make it into one command line using either mpr: or clones. Reference: https://stackoverflow.com/questions/483 ... ize-in-ima
Code: Select all
T="65000"
sigma=5
magick logo: I.mpc
magick I.mpc -blur 0x$sigma G.mpc
magick I.mpc G.mpc +swap -define compose:clamp=off -compose minus -composite \
G.mpc +swap -define compose:clamp=off -compose divide -composite D.mpc
M=`magick D.mpc D.mpc -define compose:clamp=off -compose multiply -composite \
-evaluate pow 0.5 -evaluate multiply $T -format "%[fx:maxima]" info:`
M2=`magick xc: -format "%[fx:2*$M]" info:`
magick D.mpc -evaluate add $M -evaluate divide $M2 -evaluate multiply $T output.png
But when doing either:
Code: Select all
T="65000"
sigma=5
magick \
\( logo: -write mpr:imgI +delete \) \
\( mpr:imgI -blur 0x$sigma -write mpr:imgG +delete \) \
\( mpr:imgI mpr:imgG +swap -define compose:clamp=off -compose minus -composite \
mpr:imgG +swap -define compose:clamp=off -compose divide -composite -write mpr:imgD +delete \) \
\( mpr:imgD mpr:imgD -define compose:clamp=off -compose multiply -composite \
-evaluate pow 0.5 -evaluate multiply $T \) \
\( mpr:imgD -evaluate add "%[fx:v.maxima]" -evaluate divide "%[fx:2*v.maxima]" \
-evaluate multiply $T \) -delete 0 output2.png
Code: Select all
T="65000"
sigma=5
magick \
logo: \
\( -clone 0 -blur 0x$sigma \) \
\( -clone 0,1 +swap -define compose:clamp=off -compose minus -composite \
-clone 1 +swap -define compose:clamp=off -compose divide -composite \) \
-delete 0,1 \
\( -clone 0 -clone 0 -define compose:clamp=off -compose multiply -composite \
-evaluate pow 0.5 -evaluate multiply $T \) \
\( -clone 0 -evaluate add "%[fx:v.maxima]" -evaluate divide "%[fx:2*v.maxima]" \
-evaluate multiply $T \) -delete 0,1 output2.png
Am I doing something wrong. I suspect the first is correct, but am not sure. It looks like there is clamping somewhere in the latter two results. Or is there a bug here.