This should be relatively easy, but who knows...
Is there a way to retrieve the number of frames in a multi-page TIFF file using PIL/Pillow, without iterating through the whole stack until seek
raises an error?
Try using n_frames
:
from PIL import Image
tiffstack = Image.open('my_img.tiff')
tiffstack.load()
print(tiffstack.n_frames)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With