Page MenuHomePhabricator

Add support for AVIF: allow uploading AVIF files to Wikimedia servers
Open, LowPublic

Description

Per the request at this ticket: https://phabricator.wikimedia.org/T257652

Allow uploading AVIF as one of several open, royalty-free media types that could realistically be used in WMF projects.

For the steps required see:
https://www.mediawiki.org/wiki/Manual:Adding_support_for_new_filetypes

Event Timeline

Reedy changed the task status from Open to Stalled.Jul 11 2020, 10:51 AM
Reedy subscribed.

Marking stalled as per T257652; there's a lot of prep work that needs doing before this is done

As I mentioned in T257652#6381839, thumbnailing from AVIF to PNG/JPG/WebP would be feasible. It would require new versions of ImageMagick, libheif, and libaom that Debian doesn't package for any release, not even unstable. I don't see the benefit of using AVIF if we're going to convert it to another format before it's served though.

I don't see the benefit of using AVIF if we're going to convert it to another format before it's served though.

There is currently no Wikimedia supported lossy image format that allows >8 bit precision.
8-bit is insufficient for wider gamut color profiles (results in color banding), and sRGB does not encompass all the colors captured by current cameras and development software. (Those were the requirements set in 1996.)

At the moment, TIFF is the only image format that allows greater precision, and as a typically lossless format it's hugely wasteful. I don't care which higher precision format is added (JPEG 2000, JPEG XS, JPEG XT, JPEG XL, AVIF), but one is needed. AVIF seems to be farther along in web browser implementation so it probably makes the most sense to start there.

See also: https://commons.wikimedia.org/wiki/Commons_talk:Quality_images_candidates#Use_of_16-bit_tif_format_to_preserve_depth_of_colors

I wanted to give my support to adding AVIF format especially to allow upload AVIF images to Commons. In fact, that should be a primary use case more than any other.
AVIF is supported now in all the major operating systems and image software.
Agree with @Trougnouf that we should think of the other side of things, storage and convenience for users. HDR 8K + ranges are supported by AVIF.
Our wiki article https://en.wikipedia.org/wiki/AVIF is excellent to gain a sense of support now in 2023, and a few other highlights are mentioned on a Mozilla dev page https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types#avif_image

Marking stalled as per T257652; there's a lot of prep work that needs doing before this is done

T257652 is about making AVIF thumbnails the default format; that is not a requirement for AVIF support. Can thumbnails be generated from AVIF files? That is unlikely to be an issue with today's software support (AVIF is supported in Thumbor, ImageMagick, all modern browsers, ...)

TheDJ subscribed.

For those interested in working on this, I've added to the issue description, the standard list of steps needed to add file formats

TheDJ changed the task status from Stalled to Open.Feb 5 2024, 12:14 PM
TheDJ triaged this task as Low priority.

This is no longer stalled. Anyone willing to implement this can implement this. (Though I'm not sure how much AVIF material is out there and would make a valid, useful, upload. The Commons community is already complaining about webp being a format that is mostly copyrighted material downloaded from Facebook and other websites, and this likely would be similar to that.)

As a photographer who has a few thousand of his own photos on Commons: I'd support adding AVIF, and I would use it if available.

The main motivation for me to use AVIF would be the ability to add photos with greater than 8-bit color. Right now, I upload my photos as 100% quality JPEGs. If I could easily upload them in a higher-bit-depth format, I would.

I've uploaded a few of my photos as TIFFs, but those files are huge, and they don't have sharp thumbnails like JPEGs do. AVIF support would presumably let me do one upload of a small file and allow for that higher bit-depth.

WebP, by contrast, has no support for HDR or high bit-depth. But most JPEGs you can find online are copyrighted material, too.

As a photographer who has a few thousand of his own photos on Commons: I'd support adding AVIF, and I would use it if available.

The main motivation for me to use AVIF would be the ability to add photos with greater than 8-bit color. Right now, I upload my photos as 100% quality JPEGs. If I could easily upload them in a higher-bit-depth format, I would.

I've uploaded a few of my photos as TIFFs, but those files are huge, and they don't have sharp thumbnails like JPEGs do. AVIF support would presumably let me do one upload of a small file and allow for that higher bit-depth.

WebP, by contrast, has no support for HDR or high bit-depth. But most JPEGs you can find online are copyrighted material, too.

I'd also like to add that WebP does not support 4:4:4 chroma subsampling. JPEG and AVIF both supports this. MW also have a configuration setting for this on JPEG: https://m.mediawiki.org/wiki/Manual:$wgJpegPixelFormat

For my own personal use, 4:4:4 is preferred, which makes WebP unsuitable.

A note regarding colour space. My Samsung S23 and S24 uses "DCI-P3 D65 Gamut with sRGB Transfer" colour space for normal jpeg photos. WebP does support ICC profiles, so from this point of view all three formats are equal.