views:

154

answers:

2

I think the headline already explains what I want to know.
Is there a possible way to open and save images with 16-bit with Qt? And I don't mean the 3*8=24bit or 4*8=32bit, what is quite the same as a pure 8-bit image, I mean pure 16-bit for R, G and B.

+2  A: 

There are enums in the Format enum that allow QImage to load and save 16-bit per component images: http://qt.nokia.com/doc/4.5/qimage.html#Format-enum. So yes you can.

Patrice Bernassola
This information is outdated, please refer to the latest Qt documentation.
Intransigent Parsnip
You are right, I did not see it was version 4.0. I update.
Patrice Bernassola
Try one more time, http://qt.nokia.com/doc/4.6/qimage.html#Format-enum 4.6 is current.
Adam W
+1  A: 

Contrary to what Patrice says, there is no 16 bits per component format in QImage. The most you can get is QImage::Format_ARGB32 at 8 bits per component. Even if you used 8 bits indexed mode, the color tables do not support more than 8 bits per component. Moreover, the QImageIOHandler class works in terms of QImage, so you cannot create a custom image format plug-in to work with 16 bits per color component, unfortunately.

andref
QImage::Format_RGB16 The image is stored using a 16-bit RGB format (5-6-5).
Adam W
If I understood it correctly, Berschi wants 16 bits for each of R, G, and B, 48 bits in total, 64 if alpha is also needed. The format you mention allocates 5 bits for R, 6 for G (which is smart, since our eyes are more sensitive to green) and 5 for B, 16 bits in total.
andref
so thanks for the answer, 16 bit for each, that's what I want, and unfortunately this is not supported :(
Berschi