Re: Question on gdk-pixbuf



> > 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.
>
> One thing: does gdk-pixbuf support grayscale? Or do you just mean all
> your RGB pixels have R == G == B?

Dunno. I called it grayscale because I created it from a grayscale PNG file,
so probably it's R == G == B in the pixbuf.
 
> 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.

Got it, thanks. I had the composite part down, I was basically wondering
if one of the functions in gdk_pixbuf could do the first part (iterating
over C to modify A's alpha for me). I will write my own.

Thanks again Havoc.

	= L

/-------------------------------------------------------------------\
|   LOBAN AMAAN RAHMAN  <-- anagram of -->  AHA! AN ABNORMAL MAN!   |
|  MSC #763, Caltech, Pasadena, CA 91126, USA. Tel: 1-626-395-1406  |
|     loban@earthling.net, loban@caltech.edu, http://i.am/loban     |
\-------------------------------------------------------------------/




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