If you have a Pixbuf object in python and you need to have an Image object representing that Pixbuf, here’s what you need to do: import Image, gtk.gdk pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, 100, 100) # insert code that puts some graphics into that pixbuf here. im = im = Image.frombuffer("RGB", (pb.get_width(),pb.get_height()) ,pb.pixel_array, 'raw', 'RGB', [...]
↧