For example, if we want to take an image, scale it to 600 x 600, make it a bit transparent, and composite it over a white and gray checkerboard pattern, we could do this:

 1: <?php
 2
:   $pixbuf GdkPixbuf::new_from_file('shape.png');
 
3
 
4:   $cmap gdk::colormap_get_system();
 
5:   $c1 $cmap->alloc('white');
 
6:   $c2 $cmap->alloc('gray50');
 
7
 
8:   $pixbuf $pixbuf->composite_color_simple(600600GDK_INTERP_BILINEAR,
 
9:                                             2308$c1->pixel$c2->pixel);
10?>