Is there a way to save image in a different bit depth then the platform display depth ?
-
wrote on 30 Jul 2012, 14:36 last edited by
Is there a way to save image in a different bit depth then the platform display depth ?
-
wrote on 30 Jul 2012, 15:08 last edited by
See QImage::Format
http://qt-project.org/doc/qt-4.8/qimage.html#Format-enum -
wrote on 30 Jul 2012, 15:32 last edited by
The problem is that it only loads the image in this format but when I save it then it saved with the display format and not in the format I specified
-
wrote on 31 Jul 2012, 06:36 last edited by
I used the same way:
@
QImage("./myPic.png").convertToFormat(QImage::Format_ARGB8565_Premultiplied).save("./myPic.png");
@
But when i checked "./myPic.png" depth and format after the conversion it was the same as before (32 bit).
Did you try that? -
wrote on 31 Jul 2012, 06:43 last edited by
Wikipedia says:
bq. PNG supports palette-based images (with palettes of 24-bit RGB or 32-bit RGBA colors), grayscale images (with or without alpha channel), and full-color non-palette-based RGB[A] images (with or without alpha channel)
So I suppose this peculiar format just isn't supported by the PNG standard.
-
wrote on 31 Jul 2012, 10:52 last edited by
Thanks.
Do you know what happens "under the hood" when you use a .png on a 16 bit display device (is there a conversion) ?
-
wrote on 31 Jul 2012, 11:25 last edited by
There has to be a conversion, else, you'd see very funny colors and possibly sheared images. I don't know whether it happens in Qt, in the window system or the display driver. I'm guessing the window system. But you should look into the respective Qt code to see what's really going on.
-
wrote on 27 Feb 2013, 09:29 last edited by
As much as i know, you can save your image to any aviliable format, then you can apply some "image processing component ":http://www.rasteredge.com/dotnet-imaging/image-convert/to get your target.
-
wrote on 14 Feb 2014, 07:14 last edited by
if it only save image in one format. how about we convert image before saving with powerufl tool. in this way you can get a different bit depth image when you finish saving. window system is quite fine to me.
see: "image converter":http://www.rasteredge.com/how-to/winforms-net-imaging/image-converting/ /"image saving control":http://www.rasteredge.com/how-to/winforms-net-imaging/imaging-saving-printing/