Return to Snippet

Revision: 17589
at September 10, 2009 03:19 by manatlan


Initial Code
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)

Initial URL

                                

Initial Description

                                

Initial Title
convert a gtk pixbul to a pil image

Initial Tags
image, python

Initial Language
Python