Showing 16 bit grayscale image on QImage (Format_Grayscale16)
-
I have 16 bit grayscale image as opencv Mat object. I am trying to create a QImage with it and it works ok at qt 6.4. But I need to be able to compile same project at Qt 5.5 version.
Format_Grayscale16
property included at Qt 5.13. My code right now:QImage qimg(img.data, img.cols, img.rows, img.step, QImage::Format_Grayscale16);
So this gives error when trying to build at Qt 5.5 version.
Are there any options for me at this point? -
I have 16 bit grayscale image as opencv Mat object. I am trying to create a QImage with it and it works ok at qt 6.4. But I need to be able to compile same project at Qt 5.5 version.
Format_Grayscale16
property included at Qt 5.13. My code right now:QImage qimg(img.data, img.cols, img.rows, img.step, QImage::Format_Grayscale16);
So this gives error when trying to build at Qt 5.5 version.
Are there any options for me at this point?@masa4 said in Showing 16 bit grayscale image on QImage (Format_Grayscale16):
Are there any options for me at this point?
Upgrade to 5.13 or convert the image to a image format supported by Qt 5.5
-
@masa4 said in Showing 16 bit grayscale image on QImage (Format_Grayscale16):
Are there any options for me at this point?
Upgrade to 5.13 or convert the image to a image format supported by Qt 5.5
@Christian-Ehrlicher If I use 8 bit format i think i will lose quality of image, right? Are there any option to show the image as 16 bit? with qimage or with any other classes?
-
@Christian-Ehrlicher If I use 8 bit format i think i will lose quality of image, right? Are there any option to show the image as 16 bit? with qimage or with any other classes?
@masa4 said in Showing 16 bit grayscale image on QImage (Format_Grayscale16):
Are there any option to show the image as 16 bit?
Use a newer Qt version. I mean - what do you expect? Your Qt version does not provide a q6 bit grayscale so you have to work around it by the two options I gave to you.