Re: image lib & Qt4

2006-06-03 Thread Fredrik Lundh
K.S.Sreeram wrote: > so does that mean the BGRA raw mode is supported in PIL 1.1.6? possibly; I haven't checked. it does mean that some future version will most likely support it, at least. -- http://mail.python.org/mailman/listinfo/python-list

Re: image lib & Qt4

2006-06-03 Thread K.S.Sreeram
thanks! so does that mean the BGRA raw mode is supported in PIL 1.1.6? Regards Sreeram Fredrik Lundh wrote: > K.S.Sreeram wrote: > >> I was hacking the code trying to support RGBA mode images, and >> inadvertently i tried im.tostring("raw","BGRX") on the RGBA mode image. >> >> So BGRX does indee

Re: image lib & Qt4

2006-06-03 Thread Fredrik Lundh
K.S.Sreeram wrote: > I was hacking the code trying to support RGBA mode images, and > inadvertently i tried im.tostring("raw","BGRX") on the RGBA mode image. > > So BGRX does indeed work for RGB mode images. > > While trying to support RGBA mode images, i realized that a BGRA raw > mode is neede

Re: image lib & Qt4

2006-06-03 Thread K.S.Sreeram
My bad. I was hacking the code trying to support RGBA mode images, and inadvertently i tried im.tostring("raw","BGRX") on the RGBA mode image. So BGRX does indeed work for RGB mode images. While trying to support RGBA mode images, i realized that a BGRA raw mode is needed for working with QImage.

Re: image lib & Qt4

2006-06-03 Thread Fredrik Lundh
K.S.Sreeram wrote: > I'm getting an 'unknown raw mode' error on ImageQt.py:59: > data = im.tostring( "raw", "BGRX" ) > > Does this only work with PIL 1.1.6 snapshots? I currently have > PIL 1.1.5. it was developed on Python 2.4.3 and PIL 1.1.5, so it should work. and BGRX support has been i

Re: image lib & Qt4

2006-06-03 Thread K.S.Sreeram
Fredrik Lundh wrote: > Fredrik Lundh wrote: > > I've posted a simple ImageQt interface module for PIL and PyQt4 here: > > http://svn.effbot.python-hosting.com/stuff/sandbox/pil/ImageQt.py > I'm getting an 'unknown raw mode' error on ImageQt.py:59: data = im.tostring( "raw", "BGRX" ) Doe

Re: image lib & Qt4

2006-06-03 Thread Fredrik Lundh
Fredrik Lundh wrote: >> To get better performance, you should be able to use PIL's tostring() >> method together with the QImage(buffer, width, height, depth, >> colortable, numColors, bitOrder) form of the QImage constructor. I've posted a simple ImageQt interface module for PIL and PyQt4 here

Re: image lib & Qt4

2006-06-01 Thread Fredrik Lundh
Fredrik Lundh wrote: > To get better performance, you should be able to use PIL's tostring() > method together with the QImage(buffer, width, height, depth, > colortable, numColors, bitOrder) form of the QImage constructor. for PyQt4, that seems to have changed to QImage(buffer, width, height,

Re: image lib & Qt4

2006-06-01 Thread Fredrik Lundh
aljosa wrote: > does anybody know how to load (in-memory > representation of PNG image) from Qt (v.4.1.3) as QImage? If you want the data from a StringIO object, you can either *read* the data from the object (it's a file-like object, after all), or use the getvalue() method. Something like

Re: image lib & Qt4

2006-06-01 Thread aljosa
does anybody know how to load (in-memory representation of PNG image) from Qt (v.4.1.3) as QImage? Diez B. Roggisch wrote: > aljosa wrote: > > > i'm looking for image lib which supports common image types (maybe > > freeimagepy?) and is relatively easy to display image loaded through > > that lib

Re: image lib & Qt4

2006-06-01 Thread Diez B. Roggisch
aljosa wrote: > i'm looking for image lib which supports common image types (maybe > freeimagepy?) and is relatively easy to display image loaded through > that lib in PyQt4. > any ideas? Use PIL & StringIO to create a in-memory representation of the image as e.g. PNG. Load that using Qt. Diez -