[PyQt] QImage in BI24 format

David Boddie david at boddie.org.uk
Wed Sep 19 22:32:11 BST 2012


On Wed, 19 Sep 2012 09:31:55 -0700, Matt Newell wrote:

> On Wednesday, September 19, 2012 12:19:31 AM Gelonida N wrote:
> > On 09/18/2012 08:13 PM, Gelonida N wrote:

> > > I tried to set the pixel format to QImage.Format_RGB888
> > > and I can see the image.
> > > However the red and blue colors are inversed.
[...]
>
> Any conversion is going to need to be implemented in C++ for best speed.

Possibly, though it might be possible in the general case to use the Python
Imaging Library to manipulate channels in an image.

The simplest solution might be to call the rgbSwapped() method on the QImage
holding the data to obtain an image with the red and blue channels swapped.
This is, of course, done in C++ by the Qt library itself.

David


More information about the PyQt mailing list