Marmstrong
Marmstrong

Reputation: 1786

python PIL acces multiple images from a single image file

I have written a python script to Delta compress an image. The image file format is .tif which contains 8 images. When I use the normal code ...

org_Image = Image.open(image)
org_Data = org_Image.load()

... I can only access the first image. How do I go about accessing the other ones?

Upvotes: 0

Views: 396

Answers (1)

Steve Barnes
Steve Barnes

Reputation: 28370

You use org_Image.seek(org_Image.tell() + 1) to get the next one.

In PIL seek moves you to a given frame, (with an IO_Error if it doesn't exist), and tell reports the current frame number.

Upvotes: 2

Related Questions