Re: Question on gdk-pixbuf



On Sat, 24 Jun 2000, Havoc Pennington wrote:

> Loban Rahman <loban@enigma.caltech.edu> writes:
> > I've got a quick question. What's a good way of compositing a pixbuf A
> > onto a pixbuf B using pixbuf C as an alpha mask, resulting with a pixbuf
> > D? A and C are color pixbuf's with alpha channels. C is a greyscale pixbuf.
> > 
> > I've been reading the gdk_pixbuf documentation, but I'm a bit muddled.
> > 
> 
> Well, it's not like this is going to be documented, since it's a
> pretty weird thing to do. ;-)

Actually, I asked for this very same thing about a month ago.

> One thing: does gdk-pixbuf support grayscale? Or do you just mean all
> your RGB pixels have R == G == B?

I suspect the obvious interpretation of taking one pictures rgbs and
other's alpha is what is intended.

> Basically you want to make a copy of pixbuf A, then iterate over the
> pixels of C and modify the alpha of the copy of A according to the
> intensity of the pixels in C, then composite the modified-alpha
> version of A onto B. If you want a separate pixbuf D, then copy B
> first to create D, then composite A onto D instead of onto B.

Yuck.  Gnome-font is going to be very slow then.

njh





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