Page 1 of 1

Evaluate bug ?

Posted: 2012-07-14T02:10:46-07:00
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

Re: Evaluate bug ?

Posted: 2012-07-15T18:14:40-07:00
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