Adding HEIF support to Blender

While testing the new USD-importer branch I noticed some USDs of Apple products didn’t import correctly, because they contained textures using the HEIF image file format (*.heic files). The HEIF format has been in use for some time now on Apple devices and I come across this format more and more. Based on what I read I think this image format might become very popular in the near future.

Currently Blender doesn’t support this format. I did some research and it seems there are some viable solutions to adding HEIF support to Blender. The most used seems to be LibHEIF, which is also used by some other open-source graphics software (GIMP, Krita, ImageMagick). Another good resource / implementation is Nokia’s HEIF website.

I played with it a little and even tried to add it to Blender myself. But so far my work is still very experimental. But before I invest some serious time in it, I’d like to know it HEIF support is something that Blender would like to have. And if the answer is yes, then what’s the proper way to add it? Right now I’ve experimenting by copying the png.c file and building off that. But I also noticed Blender uses the OpenImageIO library and later versions of that library also have HEIF support built in. So that might also be an angle to take.

1 Like

Isn’t HEIF dead yet?

And should be dead in favour for JPEG XL which is open (royality free) and beats every format and can replace all formats including: JPEG, PNG, GIF, TARGA, TIFF, EXR, RAW etc.

2 Likes

Interesting! I just read this:

That said, I don’t see why Blender couldn’t support both formats. Unless supporting it somehow introduces licensing/patenting issues.

There’s alliance for open media and memebrs are: Microsoft, Google, Facebook, Netflix, NVidia, Intel and many more tech giants. They creating open and royality free codec for video - AV1 and for image - AVIF. They are against closed and patented MPEG solutions (HEIC, h.266 and etc.) and there will be never support for these files in Chrome, Windows, Android so it’s dead. Apple is infamous for not supporting open solutions and they included saving photos as HEIC in iPhones but they not implemented support for Safari.

As an users I think we should support AV1 for video and JPEG XL for image format. We should be against solutions like HEIC and h.266 that are bad from beginning and without hope for wider adoption.

4 Likes

Some more thoughts:

Apple is infamous for not supporting open solutions and they included saving photos as HEIC in iPhones but they not implemented support for Safari.

Maybe Apple’s choice for HEIF was motivated less by it being not open/copyrighted, and evil, but more about having a good file format that’s available today (or better: a few years ago when Apple started using it) and also supports specific things they need, like being able to store bursts and cinemagraphs, support computational photography, etc. It sure seems HEIF supports a lot of handy stuff. HEIF might not pass the open media sniff test, but that doesn’t mean it’s bad perse. And who knows, Apple might switch to a different format when one is available.

I never saw HEIC as a format for displaying content on the web, but more as a storage for the originals. So I can see why Safari doesn’t support it. Apple’s desktop Photos app and macOS itself does support it.

But thanks for pointing me to that Open Media initiative. I had heard some things about it, but didn’t really know what it was.

1 Like

And of course the obvious question: why doesn’t Blender support AV1 and/or JPEG XL (or any Open Media Alliance format)? Is it too new? Maybe we should start adding that?

2 Likes

As for JPEG XL, the third sentence in your link above is:

JPEG XL is a next-generation image codec currently being standardized by the JPEG Committee.

Hard to support a standard that doesn’t exist yet. :wink:

As for AV1, I am not aware of any objections to adding it, it’s just that no one has.

2 Likes

Hard to support a standard that doesn’t exist yet.

Yeah, I already figured that out. That’s also why in my reply about why Apple probably chose HEIF, I remarked the fact that at that time they needed a format that was ready and available at that time.

Apple has been shipping some version of it in their products since 2017, OpenImageIO has supported it since 2019 even in its unofficial form, blender could have supported it, someone just needs to sits down and do the work.

Apple has been shipping some version of it in their products since 2017, OpenImageIO has supported it since 2019 even in its unofficial form, blender could have supported it, someone just needs to sits down and do the work.

EAW made that remark while talking about JPEG XL. I think your response is about HEIF, right?

1 Like

yeah i misread, mine was indeed about HEIF

1 Like