Evaluate bug ?

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
djkprojects
Posts: 21
Joined: 2012-07-06T04:44:48-07:00
Authentication code: 13

Evaluate bug ?

Post by djkprojects »

Hello,

I think there is a bug when performing evaluate on certain values.

My original pixel values are:

Code: Select all

0,0: (29812,27242, 8738) #74746A6A2222 srgb(116,106,34)
Now:

Code: Select all

-evaluate divide 64 -evaluate subtract 124
gives:

Code: Select all

0,0: ( 257, 257, 0) #010101010000 srgb(1,1,0) 
which is correct

if I subtract 125 then I get:

Code: Select all

0,0: ( 0, 514, 0) #000002020000 srgb(0,2,0) 
which is incorrect (R value has been decreased and G increased?)

If I subtract even more i.e. 129 the result is:

0,0: ( 257, 257, 0) #010101010000 srgb(1,1,0)

which is correct.

The image is in sRGB colorspace and that's the only operation I perform on it:

/opt/local/bin/convert [INPUT] -evaluate divide 64 -evaluate subtract 128 [OUTPUT]

Version: ImageMagick 6.7.7-2 2012-07-07 Q16
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Evaluate bug ?

Post by anthony »

What are you doing between commands?
Saving the image to a 8 bit image file format?

NOTE: you can output the intermediate results of the one command using

Code: Select all

    -write txt:
See Image File Hanlding, Writing images multiple times
http://www.imagemagick.org/Usage/files/#write

For example...

Code: Select all

convert [input] -write txt:  -evaluate divide 64 -write txt: -evaluate subtract 127 -write txt:  null:
NOTE null: because I already wrote the results wanted and the image can be just junked.


Also See IM Examples, Basics, Identify Alternatives
http://www.imagemagick.org/Usage/basics/#identify_alt
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply