Odd behaviour of fx & operator in 6.3.0-4

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.
Post Reply
Feagond

Odd behaviour of fx & operator in 6.3.0-4

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

Post 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.
Post Reply