Re: [Gimp-developer] caching considerations in gegl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 11 Mar 2003 18:20:34 +0100, Ernst Lippe <ernstl@xxxxxxxxx> wrote:
> On Tue, 11 Mar 2003 17:12:14 +0100
> Raphaël Quinet <quinet@xxxxxxxxxx> wrote:
> > I think that it _is_ unreasonable to expect this to work.
> Why? Normally operations on the alpha don't influence the state
> of the other color components, so I don't really see why it
> would be reasonable to assume that changing to full transparency
> is a priori different.

It works that way because the GIMP uses post-multiplied alpha and you
know it.  If we were having this discussion about a program that uses
pre-multiplied alpha (this is common in game editors, for example),
then things would be very different.

> Also it is the simplest way to implement the whole thing.

I agree.  But that doesn't mean that it makes more sense for the
user's point of view.

> > Ideally, the average user should see no difference if we suddenly
> > decided that the GIMP should work with pre-multiplied alpha (in which
> > all color information is definitely lost when making a pixel
> > transparent).  
> 
> But how do you handle the case when a user would try to make a transparent
> pixel non-transparent. This pixel should then get a color, but which
> one?

It should get the color that you are currently painting with, because
the only way to make a transparent pixel non-transparent is (or should
be) to paint in it with some tool.  You cannot create color where it
doesn't exist (or shouldn't exist).

> > So I think that we should not suggest that the alpha
> > channel is like any other channel.  Making a pixel fully transparent
> > should be considered as a destructive operation for the corresponding
> > RGB data (or let's say that the behavior is unspecified, which is a
> > good description of what happens now).
> 
> In general unspecified behavior is not a nice thing to have
> (I am almost tempted to write EVIL). In most cases where a system
> has unspecified behavior the user makes assumptions on how it
> works and is unpleasantly surprised when in a few cases the system,
> for unknown reasons, behaves very differently.

So don't do that, then!  ;-)  Nobody should rely on unspecified
behavior.  One day, someone could decide that the GIMP would work
better by compressing tiles on-the-fly in memory and clearing the RGB
data of fully transparent pixels in order to improve the compression.
And then all hacks that were relying on unspecified behavior would
suddenly break.  Who is to blame?  Not the GIMP developer, IMHO.  The
one to blame is the one who has used a feature that was not supposed
to be used.

We could of course specify that all fully transparent pixels are
always set to black.  But this is not done currently because this
would imply a small (or maybe not so small) performance penalty.

-Raphaël

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux