.HEIC and .AVIF test files

I don’t know of any devices yet that produce an AVIF directly, so in the meantime the AOM test suite is probably the best bet?

Here’s an HEIC I just took:

https://nc.patdavid.net/s/TSEgHCsamEbaQeG

(Sorry about not uploading it here - the forum is unhappy with .heic files at the moment… :slight_smile: ).

1 Like

Thank You @patdavid and @kmilos

@patdavid Very pleased to say that tvisitor.cpp the code in my book dumps your .HEIC file effortlessly. So, when the tvisitor/ISOBMFF code is ported to Exiv2, we should be able to read those files.

@kmilos I don’t know what .AVIF files are! Peter has some which have been generated by a scanning application and tvisitor.cpp successfully dumps the metadata. I am aware of aviflib, and maybe we can use images from their test suite.

They’re also ISOBMFF image files. The only difference to HEIC is that they use the royalty-free AV1 codec to store the payload instead of H.265

@kmilos The more I learn about images, the less I know. It’s an endless mess of overlapping/duplicated standards that do the same job in much the same way. What’s the point of this mess? I smell business self-interest and brand loyalty over consumer choice and open standards.

I have worked with Peter to decode the metadata in both AVIF and HEIC files. The Canon CR3 file is also ISOBMFF, however the metadata structures are 100% different. JP2000 uses yet another scheme. So, although those files are all ISOBMFF, the internal structure of the metadata depends on the file formats.

Let’s try to get a sufficient spread of test files to be confident that when everything is delivered, darktable users will be happy. I’d like test images now to avoid bug reports later!

1 Like

Collection of HEIC files from Nokia: heif_conformance/conformance_files at master · nokiatech/heif_conformance · GitHub

Collection of old AVIF files from Netflix: S3 Bucket Listing Generator

AVIF testfiles from Microsoft (already mentioned above), they have EXIF metadata: av1-avif/testFiles/Microsoft at master · AOMediaCodec/av1-avif · GitHub

I have customized plug-in(s) for GIMP using libheif and libavif. If needed I can generate some HEIF or AVIF files with EXIF and/or XMP metadata. Just let me know if you need such files.

@novomesk Thank You, Daniel for those resources and your offer of help. You are indeed a very helpful person. And of course @patdavid @kmilos @1div0 @LebedevRI @heckflosse and everbody else working on the darktable/Exiv2/ISOBMFF matter. Thanks, Everybody.

Here are two AVIF files with metadata:
Metadata are close to the beginning of the file (created via libavif):
http://188.121.162.14/avif/avif_with_metadata_exif_xmp.avif
Metadata at the end of file (created via libheif):
http://188.121.162.14/avif/avif_metadata2.avif

Thanks for the two AVIF files, @novomesk. Very pleased to say that tvisitor.cpp (the code in the book) reads these files and finds the metadata. I’ve added the two files to the test suite for the book.

Bribery will get you everywhere. I sent Gordon £10 for coffee and he sent me 14 files from an EOS R5 and a Sony A1 Camera. There are 8xHIF, 2xARW and 4xCR3. Very pleased to say that tvisitor (the code in my book) reads the files and displays the Exif metadata. Tomorrow, I’ll analyse the files carefully.

For the moment, the files on the Exiv2 buildserver and I have let Gordon know that I plan to share them with the community.

I understand that a new sub-domain for test images is to be established on pixels.us and I hope to share those files with the community when that’s available.

If anybody else would like to show appreciation for Gordon’s contribution, you can buy him coffee via PayPal on his blog. https://www.cameralabs.com/?s=heif

@novomesk Daniel. I put your images avif_metadata2.avif and avif_with_metadata_exif_xmp.avif into the Exiv2 test suite. Exiv2 parses the Exif and XMP data beautifully. Today, I thought, “what’s in those files?” and downloaded Chrome. OMG. It’s my avatar from GitHub. Thank You. You made me laugh.

A couple of questions about AVIF files. Do you have any images with any of the following:

  1. Thumbnail/previews
  2. ICC profile
  3. IPTC metadata

I’m hoping the answer is “no” because that will save me lots of work and testing!

We had a Team Exiv2 meeting on Saturday. We’ve decided to hibernate the Exiv2 project after v0.28 in Fall 2021 as we don’t have a maintainer. We’re hoping to have a mountain retreat weekend in Bavaria in the Fall. I hope you’ll be able to join us. Some hiking, talking, eating and boozing. Bavaria is about the centre of gravity of the contributors.

https://github.com/Exiv2/exiv2/issues/1466#issuecomment-787129589

I think answer for 3. is no. I am not sure.

There could be thumbnails, for example av1-avif/Tomsk_with_thumbnails.avif at master · AOMediaCodec/av1-avif · GitHub (The primary image is encoded at 1280x720. The file contains two embedded thumbnails, encoded at 320x180 and 160x90 resolution, respectively.)
I think thumbnails are stored in the format, not in the metadata.

I have AVIF with ICC: http://188.121.162.14/avif/avif_icc.avif
But ICC is saved din the format, not in the metadata. We do not need Exiv2 to handle it.

Thanks @novomesk. Exiv2 deals with metadata (Exif, IPTC and XMP) and three cousins: ICC, Previews and Comments. Sometimes the cousins are in the metadata (for example in Tiff) and often elsewhere in the file.

Exiv2 v0.27.4 RC1 is due on 2021-03-31. It’s more important to make that milestone than to worry about the “cousins”.

I’ll ask @1div0 to test the current version of our code with your test images in https://github.com/AOMediaCodec/av1-avif.git

Thanks for you help with this matter.

1 Like

If it helps, there is also an AVIF sample w/ ICC profile in the topic here. Exported from darktable using libavif.

Thanks @kmilos Miloš. I have ICC profiles in the test harness. It’s thumbnail/previews that are my main concern. Alex has searched the darktable code and we believe they generate/cache thumbnails for themselves. I hope to finish the bmff PR today. @1div0 has agreed test and review it.

Thank you for the lilienstein files. There’s an XMP parsing error to be investigated:

626 rmills@rmillsm1:~/Downloads/lilienstein_1k_HLG $ exiv2 -pS *.avif  >/dev/null
Error: XMP Toolkit error 201: XML parsing failure
Error: XMP Toolkit error 201: XML parsing failure
627 rmills@rmillsm1:~/Downloads/lilienstein_1k_HLG $ ls -l
total 3376
-rw-r--r--@ 1 rmills  staff  858852 10 Feb 10:41 lilienstein_1k_HLG_cicp.avif
-rw-r--r--@ 1 rmills  staff  867938 11 Feb 11:04 lilienstein_1k_HLG_icc.avif
628 rmills@rmillsm1:~/Downloads/lilienstein_1k_HLG $ 

Your files have an infe/av01Color record which I will investigate:

637 rmills@rmillsm1:~/Downloads/lilienstein_1k_HLG $ exiv2 -pS * | grep -i col
    Exiv2::BmffImage::boxHandler: infe      142->26 ID =   1 av01Color 
      Exiv2::BmffImage::boxHandler: colr      232->19 
    Exiv2::BmffImage::boxHandler: infe      142->26 ID =   1 av01Color 
      Exiv2::BmffImage::boxHandler: colr      232->9088 
      Exiv2::BmffImage::boxHandler: colr     9320->19 
638 rmills@rmillsm1:~/Downloads/lilienstein_1k_HLG $ 

I think you and @novomesk are country-men. Share transport to join us in Bavaria in the Fall?

I think that’s right, I don’t recall previews being embedded into e.g. exported TIFFs…

That’s very strange, as there should be no XMP data in those files - darktable currently does not pass XMP data to the AVIF export method AFAIK (only Exif so far), and inserting it via exiv2 in a second pass like it is done for other formats is not supported yet obviously… ExifTool does not show any XMP data or warnings.

Ha, that’s still the remnants of Cold War habits talking there Robin :wink: We’re not - relatively close, a few 100s of km south-east, but I’m not based in the region any more. You don’t need to sell me on the Bavaria get together, but my managers: the real day job one, the wife, and the toddler :wink:

@kmilos I lived and worked in the States before I retired in England. I have only a vague idea about the location of the countries behind the iron curtain. One day we’ll have a road trip.

Good news from the tests: I have investigated the XMP puzzle and can’t find XMP in those files either. My code extracts the ICC profile from lilienstein_1k_HLG_icc.avif. So everything looks fine.

Bring your wife and toddler. I’m thinking of a cabin in the woods. My wife will come. Our toddlers are now 44 and 45, and have to stay home to supervise the teenage grand-kids.

I looked at Tomsk_with_thumbnails.avif. It’s a small file. Looks like the image+2 thumbs are in sequence of ‘info’ boxes. The offset/length of those objects are in the iloc box.

518 rmills@rmillsm1:~/gnu/github/av1-avif-master/testFiles/Microsoft $ ls -l T*
-rw-r--r--@ 1 rmills  staff  10864  8 Feb 09:31 Tomsk_with_thumbnails.avif
519 rmills@rmillsm1:~/gnu/github/av1-avif-master/testFiles/Microsoft $ exiv2 -pS Tomsk_with_thumbnails.avif 
...
    Exiv2::BmffImage::boxHandler: infe      105->21 ID =   1 av01 
    Exiv2::BmffImage::boxHandler: infe      126->21 ID =   2 av01 
    Exiv2::BmffImage::boxHandler: infe      147->21 ID =   3 av01 
    Exiv2::BmffImage::boxHandler: infe      168->21 ID =   4 Exif  *** Exif ***
  Exiv2::BmffImage::boxHandler: iloc      189->72 
       197 |       14 |   ID |    1 |   1775,  7618
       211 |       14 |   ID |    2 |   9393,  1409
       225 |       14 |   ID |    3 |    564,  1211
       239 |       14 |   ID |    4 |  10802,    62
...

Alex and I have investigated how darktable handles thumbnails and it generates and caches them without using Exiv2::Preview. Exiv2 will not provide Preview/thumbnail support for bmff. Exiv2::Preview only handles previews stored in Exif, so its use is limited. If an avif file stored a thumbnail in Exif, it would be respected.

When the bmff PR has been reviewed and merged, I’ll proceed to prepare Exiv2 v0.27.4 RC1.

I hope it’s not forbidden to cross-post in two Pixels.us forums. I promise not to abuse this.

I have downloaded 2.10.30 to my Apple M1 MacBook Pro running Big Sur, and I cannot find the option for exporting an image as AVIF, as described on many web sites, include the Gimp official site: GIMP 2.10.22 Released - GIMP. I also tried downloading 2.99.8. It doesn’t seem to offer the option either. Also, I cannot load an .avif image into either of these versions of gimp. Specifically, I tried one of the .avif test files here: https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles/Microsoft (recommended in another Pixls.us Gimp forum), and received a popup error saying “Unknown file type”, suggesting that they don’t support AVIF files. Am I doing something wrong? Has AVIF support been removed? Is it the fact that I’m using a Mac?

The Mexico.avif file opens fine with GIMP 2.10.30 on Windows. and I can save changes back. I think it’s a macOS problem.

You should open an issue: