Bug 138668 - support image format AVIF import
Summary: support image format AVIF import
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Format-Filters Images
  Show dependency treegraph
 
Reported: 2020-12-05 06:53 UTC by Markus
Modified: 2024-04-22 11:13 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus 2020-12-05 06:53:59 UTC
Description:
Avif is able to serve better image quality at much lower file size.

Steps to Reproduce:
Try loading a avif file.

Actual Results:
It fails (unsupported image format)

Expected Results:
It loads and works like every other image.


Reproducible: Always


User Profile Reset: No



Additional Info:
.
Comment 1 Ming Hua 2020-12-05 08:10:06 UTC
Valid request, setting to NEW.

But according to bug 114533 the developers have been reluntant to add support for new image formats unless there are compelling reasons.  So keep that in mind.
Comment 2 Tomaz Vajngerl 2020-12-05 09:44:43 UTC
AVIF support makes sense, but let's wait for better tooling support and a more wide-spread support in apps.
Comment 3 V Stuart Foote 2020-12-05 15:53:16 UTC
Love to see it.

As a counter point to MPEG's HEIF format, the patent & royalty free FOSS AVIF image format with AV1 compression is gaining acceptance and would be useful in LibreOffice as an additional bitmap image *import* filter. 

If widely accepted, then potentially AVIF could become an additional bitmap image *export* filter (to supplement BMP, GIF, TIFF, JPEG, and PNG) if we can provide an encoder.

Might get there quicker if able to implement complete AV1 encoder in an effort for a "full motion" export format for Impress presentations, and address bug 34959
Comment 4 Heiko Tietze 2020-12-07 11:31:36 UTC
Looks like AVIF is AV1, described here https://en.wikipedia.org/wiki/AV1. Don't see LibreOffice compete with streaming platforms where this codec is used. But no objection UX-wise.
Comment 5 Christian Lohmaier 2020-12-10 15:20:42 UTC
This is "not our bug" - LibreOffice itself doesn't deal with video itself, it rather offloads that to gstreamer (linux) or windows directX/Directshow based codecs and AV-foundation stuff on mac. (and there's an vlc backend as well).

so it is more about installing proper codecs on your mac/win/linux box/relies on those frameworks adding support for it. LibreOffice itself doesn't do audio/video processing.
Comment 6 Markus 2020-12-10 15:39:19 UTC
AVIF is an image format, not video. But its true that its related to AV1.

Similar to HEIF (image) and HEVC (Video) or JPEG (image) and MJPEG (video).
Comment 7 V Stuart Foote 2020-12-10 15:55:28 UTC
(In reply to Christian Lohmaier from comment #5)
> This is "not our bug" - LibreOffice itself doesn't deal with video itself,
> it rather offloads that to gstreamer (linux) or windows directX/Directshow
> based codecs and AV-foundation stuff on mac. (and there's an vlc backend as
> well).
> 
> so it is more about installing proper codecs on your mac/win/linux
> box/relies on those frameworks adding support for it. LibreOffice itself
> doesn't do audio/video processing.

No, we are *not* talking about embedding or generating an Alliance for Open Media AV1 encoded video stream.

Rather AVIF is a static raster bitmap, comparable to GIF, PNG or JPEG. An LO import filter for the format is reasonable, especially as AVIF gains broader acceptance for frame grabs (as AOM AV1 encroaches on the MPEG market).

A LO Bitmap export to AVIF raster would not be a priority. But would expect that if LO were to make any progress on bug 34959 and possibly make use of an AV1 encoder (i.e. libaom) to render presentations to HEIF video, that AVIF bitmap export would come along with the effort.

This is for read only filter import of the AVIF raster image format.
Comment 8 Buovjaga 2020-12-10 16:56:29 UTC
I first learned about the format here and I think it is a good intro: https://jakearchibald.com/2020/avif-has-landed/
Comment 9 Pieter de Bruijn 2022-08-18 13:06:08 UTC
Now that WebP is officially supported by LibreOffice 7.4, it might be a good moment to revisit AVIF support. AVIF is the image format derived from AV1 (just like WebP is derived from the VP8 video codec). Supporting open formats should be important to Open Source software the likes of LibreOffice.
Comment 10 Buovjaga 2022-08-19 10:59:20 UTC
(In reply to Pieter de Bruijn from comment #9)
> Now that WebP is officially supported by LibreOffice 7.4, it might be a good
> moment to revisit AVIF support. AVIF is the image format derived from AV1
> (just like WebP is derived from the VP8 video codec). Supporting open
> formats should be important to Open Source software the likes of LibreOffice.

Note comment 2.

Even browser support is not complete for the major ones: https://caniuse.com/avif
No support yet in MS Edge or Apple Safari.

As the support is not wide-spread in browsers, it means web developers can't use AVIF without a fallback to some other image format. Thus it is unlikely that users would face problems copying & pasting web content to LibreOffice, for example.

So it seems there is no hurry for the next LibreOffice version to support it. Of course, if someone feels it would be cool to work on the feature, it would be welcomed.
Comment 11 Pieter de Bruijn 2022-08-20 13:19:30 UTC
(In reply to Buovjaga from comment #10)
> (In reply to Pieter de Bruijn from comment #9)
> > Now that WebP is officially supported by LibreOffice 7.4, it might be a good
> > moment to revisit AVIF support. AVIF is the image format derived from AV1
> > (just like WebP is derived from the VP8 video codec). Supporting open
> > formats should be important to Open Source software the likes of LibreOffice.
> 
> Note comment 2.
> 
> Even browser support is not complete for the major ones:
> https://caniuse.com/avif
71%, but Apple has full support nowadays, so the list is incomplete/old:
https://www.cnet.com/tech/mobile/apple-endorses-new-avif-photos-for-a-faster-web-on-ios-16/

> No support yet in MS Edge or Apple Safari.
Safari (MacOS and iOS) do support AVIF. MS Edge is the only one not yet supporting AVIF; but Microsoft is now a member of Alliance for Open Media (the organisation behind AV1 and AVIF) so that will be forthcomming.
Comment 12 Buovjaga 2022-08-20 18:25:19 UTC
(In reply to Pieter de Bruijn from comment #11)
> (In reply to Buovjaga from comment #10)
> > Even browser support is not complete for the major ones:
> > https://caniuse.com/avif
> 71%, but Apple has full support nowadays, so the list is incomplete/old:
> https://www.cnet.com/tech/mobile/apple-endorses-new-avif-photos-for-a-faster-
> web-on-ios-16/
> 
> > No support yet in MS Edge or Apple Safari.
> Safari (MacOS and iOS) do support AVIF.

If you look at the footnotes in the caniuse page, they have

"Only available on macOS 13 Ventura or later"

macOS 13 final release will be out in the fall. Safari 16 is still in technology preview status.

The fact remains: any web dev using exclusively AVIF images would be shooting themselves in the foot right now.
Comment 13 Logan Shire 2022-11-03 17:19:35 UTC
Hey folks! With the release of iOS 16 + MacOS Ventura I was excited to add support for AVIF images to my app. While yuv420 and yuv444 AVIF images seem to work well, I've found that yuv422 images don't render for me. 

You can find some examples in the official AOMediaCodec repo:
https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles/Link-U

Example:
https://github.com/AOMediaCodec/av1-avif/blob/master/testFiles/Link-U/fox.profile2.10bpc.yuv422.avif

Does Apple and/or WebKit not support these types of AVIF images? Is the set of allowed encodings documented somewhere? Or is this a bug?
Comment 14 Buovjaga 2022-11-03 19:48:32 UTC
(In reply to Logan Shire from comment #13)
> Does Apple and/or WebKit not support these types of AVIF images? Is the set
> of allowed encodings documented somewhere? Or is this a bug?

As you say yourself, in Safari they are supported on macOS Ventura. Check the caniuse page, still no support in Edge.
Comment 15 Logan Shire 2022-11-04 03:33:25 UTC
@Buovjaga they are partially supported -- I am able to get 4:2:0 and 4:4:4 AVIF images to work but not 4:2:2 images.
Comment 16 SlyCooperKing 2023-09-16 18:38:39 UTC
How would one assist in this endeavor? I'd love to see this enhancement.
Comment 17 arturs.pupausis 2024-01-23 02:24:48 UTC Comment hidden (no-value)
Comment 18 Piotr Osada 2024-04-22 11:13:25 UTC
Adding this link as a reference for:
"AVIF" user post on 2021-02-07 (to broaden the scope of the discussion):

[1]
https://blog.documentfoundation.org/blog/2021/02/03/libreoffice-7-1-community/