Package: gdk-pixbuf

Function gdk-pixbuf-add-alpha

Lambda List

gdk-pixbuf-add-alpha (pixbuf substitute red green blue)

Arguments

pixbuf -- a gdk-pixbuf object
substitute -- a boolean whether to set a color to zero opacity, if this is false, then the (red, green, blue) arguments will be ignored
red -- an unsigned char with the red value to substitute
green -- an unsigned char with the green value to substitute
blue -- an unsigned char with the blue value to substitute

Return Value

A newly created pixbuf with a reference count of 1.

Details

Takes an existing pixbuf and adds an alpha channel to it. If the existing pixbuf already had an alpha channel, the channel values are copied from the original; otherwise, the alpha channel is initialized to 255 (full opacity).

If the substitute argument is true, then the color specified by (red, green, blue) will be assigned zero opacity. That is, if you pass (255, 255, 255) for the substitute color, all white pixels will become fully transparent.
 

See also

2021-12-12