Repository navigation
Unable to open AVIF images #7983
Description
Activity
Yes, this is format that Pillow does not support yet. See https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html for the formats Pillow does support.
#5201 has been created as a possible solution.
Reacted by Sohang Chopra and Park Hee Chan- changed the title
[-]Unable to open images in avif format[/-][+]Unable to open AVIF images[/+]on Apr 16, 2024 Here's my question: when the linked PR is merged, will it still be possible to write a plugin for AVIF or modify the linked PR (or Pillow) to allow specifying not only the format during read and write operations but also a specific codec to use?
I’m asking because I know several people who specifically want to use the
SVT-AV1codec instead ofaom. If Pillow does not support having multipleImageFile.ImageFileinstances for the same format in parallel, I would avoid putting in the effort to addSVT-AV1support topillow_heif, as it wouldn’t be usable after the linked PR is merged.Thank you!
Edited:
I understand that people can build from source with the necessary encoder/decoder, but most people use Windows, and there it is a pain with this, and they need binary wheels with the codecs they need.
If try to put all the encoders/decoders into binary wheels, then this is simply an unrealistic release size(from my point of view at least)
If Pillow does not support having multiple
ImageFile.ImageFileinstances for the same format in parallelIt does.
Naturally, you can only open or save an image using one format at a time, and the extension ".avif" can only pick one ImageFile when saving.
However, if you wanted to have two ImageFiles registered at once, one could have the
formatof "AVIF1", and thenImage.open("in.avif", formats=["AVIF1"])orim.save("out.avif", format="AVIF1")would use that. See https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open and https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save for the documentation.Reacted by Alexander PiskunAVIF is widely supported now, at least among browsers, viewers, converters (ImageMagick, GraphicsMagick, libgd), image editors. But looks like the proposed patch has not been applied? It is pending a reviewer since 2021.
Reacted by Sohang Chopra, oganii and lukesoloThe reviewing process has picked up speed in the last two months.
Reacted by alexbondar92, Popolon and lukesolo
I have a picture here in avif format:https://img10.360buyimg.com/n7/jfs/t1/194600/2/37658/144533/652f464dF8dc6bd47/3aada6e1078054ae.jpg.avif
Opening with pillow results in an error