Steinar H. Gunderson wrote:
On Tue, Mar 11, 2003 at 06:36:47PM +0100, Sven Neumann wrote:

which operation (besides the evil anti-erase) wouldn't have such a
color information? The only operation I can think of that makes a
transparent pixel non-transparent is some sort of painting with one of
the paint tools. Such a paint operation always has the color
information we need.


/* Steinar */

I don't think Blur counts here.

Alpha is a measure of the amount of coverage of the pixel. (e.g. an alpha of .5 means half the pixel is covered). In particular, 0 alpha means that the pixel is not covered at all. This means that the pixel contributes NO color information. I think this should hold for blur as well. And from that point of view, no pixel with alpha zero should ever contribute color information.

Another way to look at it is that alpha is as important to the color information as the actual RGB channels. No operation should be performed without considering the alpha channel (except for a color-space conversion, which isn't really an issue in gimp-current, also, please correct me if I am wrong). Thus alpha is an inherent part of the color information. Thus if alpha is zero, our math tells us the color is non-exsistant.

Another way to look at it is that alpha is a solution to the aliasing problem when you try to draw lines (say the bounding lines of a polygon) at arbitary angles. Sub-pixel precision tells us that the line doesn't cover an entire pixel, so we use alpha as an approximation to express this partial coverage of edges. But alpha here is an essential part of the edge. It tells us, approximatly how far the edge extends into the pixel. Thus a blur operation that was applied to the edge is incorrect if is doesn't take into account the alpha.

A better implementation of anti-erase would try to keep an old version of the tile around, so that it could just read the old color data back when necessary, but at this point, why not just use a mask layer (since you are effectively keeping one around anyway)?

Incidentally, gegl premultiplies it's images, so if anyone really really wants to use unerase in gimp 2.0, please voice an opinion so we can consider not pre-multiplying.

-- Dan

Gimp-developer mailing list

Reply via email to