1

I'm analyzing electron microscopy images currently and when I open the TIFF images in a text editor there are several hundred rows of image information such as the Image Pixel Size accounting for the magnification (Row 1347) before the actual pixel gray values begin. I don't have trouble loading the image as a numpy array with skimage.imread but I haven't found a way to access the information before that in python. I have tried PIL and exifread but could not get it to work. Maybe someone knows how to read TIFF images "as text". You can find an exemplary image here:

Exemplary TIFF Image

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
Mika R.
  • 53
  • 5
  • 1
    Does this answer your question? [Reading tiff image metadata in Python](https://stackoverflow.com/questions/46477712/reading-tiff-image-metadata-in-python) – mkrieger1 Jul 31 '23 at 09:28
  • I've tried these solutions already but could not get them to work unfortunately – Mika R. Jul 31 '23 at 10:20
  • Maybe you should show a [mre] of what doesn't work. – mkrieger1 Jul 31 '23 at 14:46
  • 1
    [tifffile](https://pypi.org/project/tifffile) has a parser for SEM metadata: `py -c"from tifffile import TiffFile;tif=TiffFile('FS1_b3_14.tif');print(tif.sem_metadata)"` – cgohlke Jul 31 '23 at 19:18

0 Answers0