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.
possible bug in -colorize in IM 6.4.1-8
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
possible bug in -colorize in IM 6.4.1-8
Last edited by fmw42 on 2008-06-20T21:24:31-07:00, edited 4 times in total.
Re: possible bug in -colorize in IM 6.4.1-8
The problem you reported is fixed in the subversion repository.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug in -colorize in IM 6.4.1-8
Sorry, what is the subversion repository?
It is not urgent for me. I can wait until the next release or if you want me to test, I can test in the next beta.
Fred
It is not urgent for me. I can wait until the next release or if you want me to test, I can test in the next beta.
Fred
Re: possible bug in -colorize in IM 6.4.1-8
The patch will require more thought. Take a look at http://www.imagemagick.org/Usage/color/. Any patch I add ends up breaking this section of the usage examples, suggesting -colorize may be behaving properly. Why not run it by Anthony and see what he says about it.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug in -colorize in IM 6.4.1-8
OK, I just sent him email.
Thanks.
Thanks.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: possible bug in -colorize in IM 6.4.1-8
You have NOT specified the 'fill' color to colorize with!!!!!
Default fill color is 'black'. colorizing with black removed color from the image!!!
As you limit it to just the red channel you effectivally remove all 'red' from the image, giving 'cyan'.
That is white, with red channel overlayed with black -> cyan
Try this instead....
the result is a white-red gradient, and you are only adding a red channel color turning black to red. white remains white as you only making the red channel of white reder and it is already at maximum.
Colorize is working correct. You are just not using it correctly!
Default fill color is 'black'. colorizing with black removed color from the image!!!
As you limit it to just the red channel you effectivally remove all 'red' from the image, giving 'cyan'.
That is white, with red channel overlayed with black -> cyan
Try this instead....
Code: Select all
convert -size 100x100 gradient: -fill white -colorize 100%,0%,0% result.png
Colorize is working correct. You are just not using it correctly!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug in -colorize in IM 6.4.1-8
I was afraid that might be the case. But I completely missed the part about the fill color. I guess I need to read more carefully. I will try some more tests. Sorry for the oversight. Thanks.