photopea / photopea

Photopea is online image editor
https://www.Photopea.com
7.49k stars 268 forks source link

Support for AV1 Image File Format (AVIF) #2242

Closed crunchtime-ali closed 4 years ago

crunchtime-ali commented 4 years ago

The abbreviation "AVIF" stands for "AV1 Image File Format" and is essentially the specification for storing still and animated images compressed with AV1 in the HEIF file format.

AVIF is a promising contender to become a widely adopted alternative to JPEG. It has better compression efficiency, a wider feature set, the AV1 image format it is based on is already widely supported.

GUI Software supporting AVIF: Firefox 77 (Beta) Paint.Net Chrome (likely in version 84 https://chromium-review.googlesource.com/c/chromium/src/+/2115212) qView (https://github.com/jurplel/qView)

Netflix is using it (see here https://netflixtechblog.com/avif-for-next-generation-image-coding-b1d75675fe4) and made even this project open source comparing multiple image formats: https://github.com/Netflix/image_compression_comparison

The AV1-AVIF spec: https://aomediacodec.github.io/av1-avif/

Encoders/decoders using WASM: https://github.com/saschazar21/webassembly https://github.com/Kagami/dav1d.js

Browser polyfill: https://github.com/Kagami/avif.js

photopea commented 4 years ago

Could you also attach your AVIF image, which you wanted to open in Photopea?

I would like our development to be driven by real needs of people. I don't want Photopea to be a "garbage bin" of "cool things", that someone has seen or heard about.

crunchtime-ali commented 4 years ago

Here is an example image: http://download.opencontent.netflix.com.s3.amazonaws.com/AV1/Chimera/AVIF/Chimera-AV1-10bit-1920x1080-6191kbps-50.avif

I ask for it because I want to use the format in my blogs (with a polyfill) for the sake of optimization. Right now I have to export and then encode the images manually.

photopea commented 4 years ago

I am a bit skeptical about this, as nobody mentioned this format here before.

Your links contain only decoders. It is not clear how large a AVIF encoder would be. We do not have resources to create our own AVIF encoder at the moment.

BTW. have you thought about using WebP? It is usually smaller than JPG.

photopea commented 4 years ago

Also, that article from Netflix is a bit misleading in my opinion, as they don't use good-quality encoders for other formats.

They say, when they exported a JPG at 13,939 bytes, they got this: image

However, when I exported it from Photopea, I got this JPG at 13,923 bytes : image (1)

crunchtime-ali commented 4 years ago

@photopea Thanks for taking your time to look into it. I am also wondering why Netflix picked such bad quality JPEGs.

How about this: For now leave the issue open and let's gauge interest in AVIF support by comments and "thumbs up" reactions. This way there can pass some time to improve 3rd party libraries and we can see whether adoption picks up.

photopea commented 4 years ago

I propose to close it for now, as I prefer to have only relevant issues in front of me. People usually search for issues before starting a new issue. If someone mentions the AVIF format again, we will look into it again.

photopea commented 3 years ago

I have added the support for AVIF files by decoding them through a browser (so it works only in browsers with AVIF support in element).