That's still not entirely consistent with the observed behavior, though, is it? If only fully-transparent pixels are touched by -alpha background, then why am I seeing a red halo at all? Those halo pixels would then, by definition, be fully transparent...yet I see them.fmw42 wrote:Anthony's message above explains that:eben wrote:Curiously, the red background halo still appears when rendered in my pipeline, but the "interior" pixels (those which were originally opaque in red.png) appear at their proper color and at 50% opacity. This strikes my as wholly weird. What makes those other semi-opaque pixels near the boundaries special such that they appear red while the remainder of the image appears as expected? I would suspect thresholding of some kind on the rendering end, but I tried this with 1/4 transparency as well and got the same result.
Just remember that -alpha background operator however will work regardless of if the images alpha channel is boolean or not. It only touches fully transparent pixels.
So those pixels have not been fixed by -alpha background
When I render the image, the pixels can be considered in three categories:
1. those which I expect to be fully transparent (the "background"), and which in fact render as such
2. those which I expect to be exactly 50% opaque (the "foreground"), and which in fact render as such, in their intended color
3. The set of pixels at the boundary (the "aliasing"), which must either be a) fully transparent or b) semi-opaque, but which for some reason exhibit the alpha color causing the halo, which is not consistent with pixels of type 1 or type 2.
My apologies if I'm missing something obvious. It's clear my understanding was a bit thin to begin with, but it seems that either the red alpha color should only apply to pixels which are actually invisible (which would result in no halo at all), or that it would somehow affect all pixels which aren't fully opaque eg. by matting them against it (which would result in an all-red image). It seems to do neither.