Skip to content

Avif support ? #557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nuranto opened this issue Nov 18, 2019 · 12 comments · Fixed by #671
Closed

Avif support ? #557

Nuranto opened this issue Nov 18, 2019 · 12 comments · Fixed by #671

Comments

@Nuranto
Copy link

Nuranto commented Nov 18, 2019

I know the support is still almost inexistant.... Just supported in Windows10 since May, and no browser supports it atm, as far as I know. (There is however a polyfill : https://github.com/Kagami/avif.js)
But the AVIF format was born earlier this year, and support will probably arrive soon everywhere (AOM initiative, from google, mozilla, apple, etc...)
The promise of this format is big, and it should - finally - be a real replacement for our current outdated formats (jpg, ..).

avif spec : https://aomediacodec.github.io/av1-avif/
libavif : https://github.com/AOMediaCodec/libavif

@willson-chen
Copy link
Member

good suggestion. IMHO, avif has a bright future. what do you think of it? @vapier

@vapier
Copy link
Member

vapier commented Nov 20, 2019

if there's a standard lib for it that we can find via pkg-config, sounds find to have as optional

@willson-chen willson-chen added this to the GD 3 milestone May 9, 2020
@Nuranto
Copy link
Author

Nuranto commented Jun 4, 2020

@vapier I'm not familiar with pkg-config but could this help ?
=> https://github.com/AOMediaCodec/libavif/blob/master/libavif.pc.cmake

@Nuranto
Copy link
Author

Nuranto commented Jun 4, 2020

Note : There's now a caniuse result for avif support : https://caniuse.com/#feat=avif
(Firefox has implemented avif support in nightly : https://www.ghacks.net/2020/05/04/mozilla-implements-experimental-avif-image-support-in-firefox-nightly/)
(Chromium team is working on it too : https://chromium-review.googlesource.com/c/chromium/src/+/2101317)
It's coming 👍

@willson-chen
Copy link
Member

Hi @Nuranto. Thanks for your concern and help.

@morsssss
Copy link
Contributor

Hey, all! I'm interested in taking this on - possibly with a collaborator at my company.

I know other folks who've integrated libavif into a project without undue trouble :)

I've not contributed to this project before. Are there guidelines a first-time contributor should follow aside from what I see here?

@vapier
Copy link
Member

vapier commented Nov 11, 2020

that doc should about cover it. if it's missing something, we should def add it!

@morsssss
Copy link
Contributor

Great - thanks @vapier !

@morsssss
Copy link
Contributor

Update: with some kind guidance from @vapier , I am making good progress on this. Stretch goal: submit PR by the end of Jan.

@cryptomilk
Copy link

@morsssss Do you have a work in progress branch somewhere? I've implemented avif support in darktable using libavif. I can offer to do a code review ...

@morsssss
Copy link
Contributor

morsssss commented Feb 1, 2021

Hi @cryptomilk ! Thanks for this offer. That would be quite helpful. In fact, as of today I've got encoding and decoding working. I need to write more tests, but I'll clean up my code and comments a bit and share this with you by Wednesday.

@morsssss
Copy link
Contributor

morsssss commented Feb 3, 2021

@cryptomilk , I just submitted my work as a draft pull request. Thanks for your help here!

vapier pushed a commit that referenced this issue Mar 2, 2021
With the adoption of AVIF by Firefox and Chromium based browsers (still
in experimental phase), the newer incorporation of HEIF by Canon and Sony 
in their cameras and the newer support of both of them in modern software 
like ImageMagick, GIMP and Krita, `gd` haven't seen any endorsement for
the formats up until this PR.

Reading and writing is done by `libheif`, with functionality for chroma 
subsampling (for now `4:2:0`, `4:2:2` and `4:4:4`), quality (with new
`200` for lossless) and compression (whether `HEVC` or `AV1`) selection. 

This was tested with `libheif` version `1.11.0` in my Solus machine.

Also, fixes both #395 and #557.
vapier pushed a commit that referenced this issue Mar 4, 2021
Demand for AVIF support on the web is growing, as the word gets out
about this new file format which allows higher-quality encoding at
smaller sizes.  Core contributors to major open-source CMSs are
interested in auto-generating AVIF images! They've been simply
waiting for support to appear in libgd.

This PR aims to meet the growing demand, and to help bring smaller,
more beautiful images to more of the web - to sites created by
experienced developers and CMS users alike.

This PR adds support by incorporating libavif in addition to the
existing libheif support.  It's generally felt that libavif has
more complete support for the AVIF format. libavif is also used
by the Chromium project and squoosh.app.

In this PR, I've endeavored to incorporate the latest research into
best practices for AVIF encoding - not just for default quantizer
values, but also an algorithm for determining the number of
horizontal tiles, vertical tiles, and threads.

Fixes #557.
@vapier vapier removed this from the GD 3 milestone Mar 5, 2021
@vapier vapier added this to the GD 2.3.2 milestone Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants