Image::RGB and Image::ARGB are really BGR and BGRA


Hi There,
It’s drivin me nuts at the moment.
If you create an Image on Windows with Image::RGB it’s really BGR.
And if you create it with Image::ARGB it’s really BGRA.

The manaul for Image::lockPixelDataReadWrite says the following.

So the format of the pixel data is not the same as that of the image.

And what about OSX, i have the feeling that it is actually RGB and RGBA and not RGB and ARGB.

Jules, could you clarify this a bit.



Well, the byte order is platform-dependent, but the idea is that if you use a PixelRGB or PixelARGB object to manipulate it, it’ll all work correctly. If you’re going to manipulate the bytes yourself, you’ll need to use the same macros that those pixel classes use to work out the ordering.


O.k thanks for clearing things up.
I thought you used your own Image class with fixed byte order.


Well, the image class could use any byte order, but by using the order that the host prefers it’s much more efficient to get it onto the screen.