I am trying to load TIF file into Python. The file has positive and negative pixel values, represented in 16 bit range.
The attached screenshot shows pixel value at some position in the TIF image when opened in ImageJ, which is equal to -2048.00 (30720). But when I load TIF in Python, negative pixel values won’t show, so the pixel value at that position in Python is 30720.
My question is, how do I load signed TIF file in Python (so that I get -2048 for pixel value like in ImageJ)?
In ImageJ, pixel value (at some position in the image) is -2048.00 (30720). When I load this TIF file in Python, pixel value is 30720
This is the code for loading TIF file in Python:
io.imread(‘image.tif’)
user24819415 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.