0

original imageI have a 16 bit tiff image. I would like to get following information from the image

  1. maximum intensity count.

  2. even though my bit size is 16 bit, why is my color bar restricted to 256 or 8 bits.

  3. histogram I have written a sample code to do the same and I do not know what are the numbers on x and y axis represent. Could you please help me with this

  4. import matplotlib.pyplot as plt

    import matplotlib.image as mpimg
    
    
    
     import numpy as np
    
    image = mpimg.imread('r1Ls01N000001.tif')
    
    plt.imshow(image,cmap='gray')
    
    plt.colorbar()
    
    plt.show()
    
    plt.hist(x=image.ravel())
    
    plt.show()
    
    imax=np.max(image)
    
    print(imax)
    

Result Imax value will be displayed as 264, is the 264 intensity count or bit number? Resulting image from my code

vashista
  • 105
  • 7
  • You have shared a 16-bit PNG rather than a TIFF. The maximum intensity is 4224. – Mark Setchell Jan 11 '22 at 13:33
  • might be a mistake while uploading, I will check that. But, how did you get that number 4224, I am interested in that. – vashista Jan 11 '22 at 15:20
  • With **ImageMagick**, using `magick identify -verbose YOURIMAGE | grep -i max` – Mark Setchell Jan 11 '22 at 15:34
  • Thank you for suggesting imagemagick. I am running imagemagick on a windows and I am getting error that grep -i max is not recognised as an internal or external command? is there a different command for Windows OS – vashista Jan 12 '22 at 22:04
  • I don't use Windows, but think you want `magick identify -verbose YOURIMAGE.TIF | FINDSTR "max" /I` – Mark Setchell Jan 12 '22 at 22:12

0 Answers0