Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
6.4.0
-
None
-
-
311e508154 (qt/qtbase/dev) 311e508154 (qt/tqtc-qtbase/dev)
Description
This code is expected to save 8bpp grayscale jpg image (with only Y component). But it creates 24bpp jpg image (with 3 components: Y Cb Cr). As there is no color information, Cb and Cr are excessive and make the result file size larger then it could be.
QImage image(10, 10, QImage::Format_Grayscale16); image.save(QDir::currentPath() + "/test.jpg", "JPG", 95);
It is similar problem with QImageWriter. Setting the subtype to "R8" doesn't make it discard Cb and Cr components.
MediaInfo for result jpeg file:
Image Format : JPEG Width : 2 560 pixels Height : 1 888 pixels Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Compression mode : Lossy Stream size : 894 KiB (100%)
Expected MediaInfo:
Image Format : JPEG Width : 2 560 pixels Height : 1 888 pixels Color space : Y Bit depth : 8 bits Compression mode : Lossy Stream size : 673 KiB (100%)