DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Convert A GTK Pixbuf To A PIL Image
import gtk
import Image
def pixbuf2Image(pb):
width,height = pb.get_width(),pb.get_height()
return Image.fromstring("RGB",(width,height),pb.get_pixels() )
pb = gtk.gdk.pixbuf_new_from_file( "p20050424_160333.jpg" )
im = pixbuf2Image(pb)
im.save("welldone.jpg", "JPEG",quality=80)




