Pixbuf.addAlpha

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 substitute_color is TRUE, then the color specified by (r, g, b) will be assigned zero opacity. That is, if you pass (255, 255, 255) for the substitute color, all white pixels will become fully transparent.

class Pixbuf
addAlpha
(,
char r
,
char g
,
char b
)

Parameters

substituteColor bool

Whether to set a color to zero opacity. If this is FALSE, then the (r, g, b) arguments will be ignored.

r char

Red value to substitute.

g char

Green value to substitute.

b char

Blue value to substitute.

Return Value

Type: Pixbuf

A newly-created pixbuf with a reference count of 1.