[Image-SIG] (transparent) PIL image to QImage conversion?
oogetbil at phys.psu.edu
Sat Apr 8 21:10:33 CEST 2006
I need to convert a PIL image to a QImage object so I
can display it in a PyQt application. I found a basic example at:
There the PIL image is converted to a string using a jpeg encoder first;
then the string is converted to a QByteArray;
then Qimage's loadFromData() function is used for the final conversion to a
My problem is, the JPEG encoding kills the transparency of my PNG images.
do RAW encoding, I get nothing from the QByteArray object. I also couldn't
the thing work with a GIF encoding. PIL's tostring() function doesn't support
Here I found a list of encodings PIL provides:
Has anybody encountered this problem?
Can I use cStringIO.StringIO() instead of PIL's tostring() somehow?
More information about the Image-SIG