Transparent geometric shapes
Posted: 2015-06-26T06:51:06-07:00
Until v6.9.0-0, we could make a geometric area transparent by negating alpha, drawing the shape, and inverting alpha again. For example, to make a transparent circle, Windows BAT syntax:
From v6.9.1-0 (and possibly earlier), to the current v6.9.1-6, this no longer works. The same command:
Drawing the circle has changed values of pixels that are outside the circle. Pixels that were transparent blue are changed to transparent black.
This looks like a bug to me, but perhaps there is a good reason.
So my questions are:
1. Is this a bug or a feature?
2. What is a simple but reliable method of making an arbitrary geometric shape transparent? I'm sure I'm missing something obvious.
Code: Select all
%IMG690%convert ^
-size 200x200 xc:Blue ^
-alpha set ^
-fill Blue ^
-channel A -negate ^
-draw "circle 100,100 100,149" ^
-negate +channel ^
trans_c1.png
From v6.9.1-0 (and possibly earlier), to the current v6.9.1-6, this no longer works. The same command:
Code: Select all
%IMG6916%convert ^
-size 200x200 xc:Blue ^
-alpha set ^
-fill Blue ^
-channel A -negate ^
-draw "circle 100,100 100,149" ^
-negate +channel ^
trans_c2.png
Drawing the circle has changed values of pixels that are outside the circle. Pixels that were transparent blue are changed to transparent black.
This looks like a bug to me, but perhaps there is a good reason.
So my questions are:
1. Is this a bug or a feature?
2. What is a simple but reliable method of making an arbitrary geometric shape transparent? I'm sure I'm missing something obvious.