Tuesday, February 9, 2010

Converting from qimage to pil image

 buffer = QtCore.QBuffer()
 buffer.open(QtCore.QIODevice.ReadWrite)
 self.qimage.save(buffer, "JPG")

 strio = cStringIO.StringIO()
 strio.write(buffer.data())
 buffer.close()
 strio.seek(0)
 pil_img = Image.open(strio)

No comments:

Post a Comment