pixbuf = gtk.gdk.pixbuf_new_from_file("image.png") pixmap,mask = pixbuf.render_pixmap_and_mask() cm = pixmap.get_colormap() red = cm.alloc_color('red') gc = pixmap.new_gc(foreground=red) pixmap.draw_rectangle(gc, False, x, y, w, h) image = gtk.Image() image.set_from_pixmap(pixmap, mask)