Page 1 of 1

possible documentation error in -fx in IM 6.4.1-1 Q16

Posted: 2008-05-18T21:47:42-07:00
by fmw42
There may be a documentation error (if not a real error in fx) on the page http://www.imagemagick.org/script/fx.php

The following does not seem correct to me:

sign(x): return 1.0 if x is less than 0.0 otherwise 0.0

For non-HDRI, I would expect sign(x) to return 0.0 if less than 0.0; otherwise 1.0
and for HDRI, , I would expect sign(x) to return -1.0 if less than 0.0; otherwise 1.0

When I try (Q16 and Q16-hdri, IM 6.4.1-2 Mac OSX Tiger)

convert xc: -format "%[fx:sign(0.5)]" info:
1

convert xc: -format "%[fx:sign(-0.5)]" info:
-1


However for Q16 non-HDRI

convert -size 10x10 xc:gray50 -fx "-u" tmp.miff

then -verbose info says it is constant 0.



Can you verify? What is the expected behaviour for 1) the documentation 2) fx escapes and 3) -fx;
for non-HDRI and for HDRI.

Thanks

Re: possible documentation error in -fx in IM 6.4.1-1 Q16

Posted: 2008-05-19T04:26:52-07:00
by magick
We fixed the sign() documentation, expect an update by sometime tomorrow.

To get negative values, explicitedly specify a floating point format:
  • convert -size 10x10 xc:gray50 -fx "-u" -define quantum:format=floating-point tmp.miff