possible bug in -colorize in IM 6.4.1-8
Posted: 2008-06-20T09:56:45-07:00
Using IM 6.4.1-8 Q16 HDRI on Mac OSX Tiger
convert -size 100x100 gradient: -colorize 100,0,0 tmp.png
or
convert -size 100x100 gradient: -colorize 100%,0%,0% tmp.png
Produces a cyan gradient rather than the expected red gradient. Seems like colors are being complemented.
convert -size 100x100 gradient: -colorize 100 tmp.png
Produces an all black image.
Interestingly,
convert grad.png -colorize 0% tmp.png
produces a red gradient. Again looking like some kind of complement of the values is being used.
A simple-minded solution is to complement the user supplied values before feeding to -colorize, namely, red->(QuantumRange - red), green->(QuantumRange - green), blue->(QuantumRange - blue). But it is not likely that simple.
The documenation for -colorize does not specify whether the values are raw (0 to QuantumRange), percent, but I get the same results either way. Perhaps once this is resolved, the documentation could be more specific about this.
convert -size 100x100 gradient: -colorize 100,0,0 tmp.png
or
convert -size 100x100 gradient: -colorize 100%,0%,0% tmp.png
Produces a cyan gradient rather than the expected red gradient. Seems like colors are being complemented.
convert -size 100x100 gradient: -colorize 100 tmp.png
Produces an all black image.
Interestingly,
convert grad.png -colorize 0% tmp.png
produces a red gradient. Again looking like some kind of complement of the values is being used.
A simple-minded solution is to complement the user supplied values before feeding to -colorize, namely, red->(QuantumRange - red), green->(QuantumRange - green), blue->(QuantumRange - blue). But it is not likely that simple.
The documenation for -colorize does not specify whether the values are raw (0 to QuantumRange), percent, but I get the same results either way. Perhaps once this is resolved, the documentation could be more specific about this.