python-pillow / Pillow

Python Imaging Library (Fork)
https://python-pillow.org
Other
12.32k stars 2.23k forks source link

Is there a way to list file types that support saving with animation? #8503

Closed BPplays closed 3 weeks ago

BPplays commented 3 weeks ago

is there a way to get a list of file types that support saving with image animation?

radarhere commented 3 weeks ago

If you mean in terms of our documentation, you could go to https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html and search for 'save_all'.

If you mean programmatically,

>>> from PIL import Image
>>> Image.init()
True
>>> Image.SAVE_ALL.keys()
dict_keys(['GIF', 'PNG', 'TIFF', 'MPO', 'PDF', 'WEBP'])
radarhere commented 3 weeks ago

Although yes, I am taking 'animation' to simply mean 'multiple images'.

In normal speech, one would not describe PDFs as being animated.

BPplays commented 3 weeks ago
>>> from PIL import Image
>>> Image.init()
True
>>> Image.SAVE_ALL.keys()
dict_keys(['GIF', 'PNG', 'TIFF', 'MPO', 'PDF', 'WEBP'])

that worked ⁤ ⁤

Although yes, I am taking 'animation' to simply mean 'multiple images'.

In normal speech, one would not describe PDFs as being animated.

that's fine for my use case