[SOLVED] How to access pixel values in 16bit Grayscale TIF?
-
I have a 16bit grayscale TIF file which I load from disc into a QImage.
Ultimately for display I will use QPixmap which is going to resample it to 8 bits, but first I want to calculate a histogram (and possibly adjust) before the 8bit downsample for display.
This seems like it should be a simple question, but how do I access the 16bit grayscale pixel values (ie. the value between 0 and 65,536)? I know I can access myImg.pixel(x,y) for any coordinate, but that only returns a QRgb.
Or am I misunderstanding QRgb?
Thanks!
-
Hi,
AFAIK, QImage doesn't support 16bit images yet (might be in the future, if someone implements it)
What you can do however is use a library like OpenCV for this kind of mathematics.
Hope it helps
-
Hi and welcome to devnet,
For 16bit tiff images processing you should rather use OpenCV