Transparency working differently in 6.5 from 6.3 and 6.4
Posted: 2009-06-29T10:00:13-07:00
Here is a command that we've been using to create a transparent watermark that later gets composited onto images:
convert -size 1000x1000 -font Times-BoldItalic -pointsize 30 -gravity center xc:transparent -draw "fill black text 1,1 'H20 MARK' fill white text -1,-1 'H20 MARK' fill transparent text 0,0 'H20 MARK'" png:test.png
This results in a black background in IM 6.5 instead of transparent in IM 6.4 and below.
I had to change it to specify transparency by using an RGBA color value:
convert -size 1000x1000 -font Times-BoldItalic -pointsize 30 -gravity center xc:"rgba(255,63,63,0)" -draw "fill black text 1,1 'H20 MARK' fill white text -1,-1 'H20 MARK' fill transparent text 0,0 'H20 MARK'" png:test.png
That results in a transparent background in IM 6.5.2, 6.4.1, and 6.3.5. But if the RGBA value either equals or is close to the text color(s), the background becomes that color instead of transparent:
convert -size 1000x1000 -font Times-BoldItalic -pointsize 30 -gravity center xc:"rgba(250,250,250,0)" -draw "fill black text 1,1 'H20 MARK' fill white text -1,-1 'H20 MARK' fill transparent text 0,0 'H20 MARK'" png:test.png
results in a white background
convert -size 1000x1000 -font Times-BoldItalic -pointsize 30 -gravity center xc:"rgba(25,25,25,0)" -draw "fill black text 1,1 'H20 MARK' fill white text -1,-1 'H20 MARK' fill transparent text 0,0 'H20 MARK'" png:test.png
results in a black background
Is this a bug?
convert -size 1000x1000 -font Times-BoldItalic -pointsize 30 -gravity center xc:transparent -draw "fill black text 1,1 'H20 MARK' fill white text -1,-1 'H20 MARK' fill transparent text 0,0 'H20 MARK'" png:test.png
This results in a black background in IM 6.5 instead of transparent in IM 6.4 and below.
I had to change it to specify transparency by using an RGBA color value:
convert -size 1000x1000 -font Times-BoldItalic -pointsize 30 -gravity center xc:"rgba(255,63,63,0)" -draw "fill black text 1,1 'H20 MARK' fill white text -1,-1 'H20 MARK' fill transparent text 0,0 'H20 MARK'" png:test.png
That results in a transparent background in IM 6.5.2, 6.4.1, and 6.3.5. But if the RGBA value either equals or is close to the text color(s), the background becomes that color instead of transparent:
convert -size 1000x1000 -font Times-BoldItalic -pointsize 30 -gravity center xc:"rgba(250,250,250,0)" -draw "fill black text 1,1 'H20 MARK' fill white text -1,-1 'H20 MARK' fill transparent text 0,0 'H20 MARK'" png:test.png
results in a white background
convert -size 1000x1000 -font Times-BoldItalic -pointsize 30 -gravity center xc:"rgba(25,25,25,0)" -draw "fill black text 1,1 'H20 MARK' fill white text -1,-1 'H20 MARK' fill transparent text 0,0 'H20 MARK'" png:test.png
results in a black background
Is this a bug?