DannyGM wrote:Thank you Anthony.
Here is my code, for changing the transparenr color
Code: Select all
convert logo: ( -size 500X500 xc:blue -transparent blue -fill yellow
-draw "circle 200,200 50,50" -blur 5X10 ) -gravity west -composite -resize 200X200 candelete.jpg
Ok you create a canvas, make it blue, then make the blue transparent, draw a yellow circle and blur it (without using -channel RGBA)
The result would in all likely hood NOT have a transparent blue. Mathematically transparent colors are undefined, and as a result generally get reset to transparent black. so that canvas will probably NOT be quite what you expect, and is likely to vary a lot from IM version to IM version.
I repeat full-transparency color is undefined, and how operators handle it is also undefined.
See the examples in blur with transparency
http://www.imagemagick.org/Usage/convolve/#blur_channel
What exactly are you wanting???? a yellow circle bluring out to a bluish semi-transparency and then full-transparency?
The best way to gurantee this is to handle the color and alpha channel separatally.
\( -size 500X500 xc:blue -fill yellow -draw "circle 200,200 50,50" \
\( xc:black -fill white -draw "circle 200,200 50,50" \) \
-blur 0x20 +matte -compose CopyOpacity -composite \)
NOTE the extra internal parenthesis for the second draw!
Now that will have a yellow circle with a blue semi-transparency.
Guranteed, and does not relay on any semi-transparent color remaining something it isn't.
In fact it will produce a higher quality result as the draw will create an anti-aliased yellow-blue color border even BEFORE the blur adds to the effect!
A simplier way is to just blue a blue border with a properly handled transparency blur (ignore transparent colors correctly)
-size 500x500 -xc:none -fill yellow -stroke blue -strokewidth 10 \
-draw "circle 200,200 50,50" -channel RGBA -blur 0x10
probably a LOT simplier to generate too!
Transparency is tricky. and relying on transparency to have a specific color is a BAD idea... period.
WARNING: as yellow is a complement of blue in RGB space the transparency shading may not be what you expect, as yellow will shade to black, in the red and green channel, while blue shades from black to semi-transparent blue to full-transparency.
As a result you will probably get a yellow - darkgray - blue - transparent gradient.
you can see this using a yellow-blue gradient image
convert -size 50x400 gradient:yellow-blue show:
Note the dark gray in the middle caused by RGB color space