Page 1 of 1

Odd behaviour of fx & operator in 6.3.0-4

Posted: 2006-11-22T11:08:40-07:00
by Feagond
Hi,

Upon upgrading imagemagick to the latest version, one of my scripts stopped working. Testing the commands individually i found out that the problem is in the -fx operator. The new behaviour is similar to the one I described some time ago in this thread: http://studio.imagemagick.org/discussio ... php?t=6982

When applying an and mask to an image using the fx operator, with the syntax:
convert <original> -fx "u&<RGBA mask in decimal>" <destination>
,if the mask is 0 or greater than 1 and less than 255 it returns all black, if the mask is 1 or greater than 254 it returns the image but extremely bright and saturated. It gives the same result in windows and linux.
It works fine on 6.2.8-4.

Thanks in advance :),

Pedro Martins

Posted: 2006-11-22T14:25:48-07:00
by magick
'u' is normalized from 0.0 to 1.0. Perhaps you want 'QuantumScale*((QuantumRange*u) & 15))' for example. If not, give us a complete example so we can investigate further. Also, the lastest ImageMagick release permits Fx statements and includes a debug() function to assist in debugging an Fx expression.