32 bit png images on device with 16 bit display

774 Views Asked by At

Does anyone know how to convert 32 bit images to show on device with 16 bit display ?

I tried to create a 24 bit image with Qt QImage - QImage QImage::convertToFormat

and save the result image, but the image I got was also 32 bit (I see the this data in the properties of the output image - Bit Depth)

1

There are 1 best solutions below

2
On

If all you want is to display the image, there's no need to convert it yourself. Just show it with any of the Qt widgets capable of displaying QImage (or QPixmap). Qt should handle the conversion on the fly.

If you need to touch the pixel data yourself, the format you are looking for may be QImage::Format_RGB16 but you have to make sure the bits layout (RGB565) is what you want.