I have a TIFF file of 7378x6923 (widthXheight) resolution. I resized it to 1200x1200 pixels using Image module in Python.
img = Image.open('path to tif file')
img = img.resize((1200,1200))
But after resizing, the pixel values show unusual values. Before resizing, a certain pixel's value was 125.28. Now, after resizing, that pixel's value has turned to 1123715645. I am reading the pixel value with:
with rasterio.open('path to tif file') as dataset:
band = dataset.read(1)
print(type(band))
value_of_interest = band[row_of_interest, column_of_interest]
print(value_of_interest)
Why does this happen?
How can I preserve the height values in same pixel position?