Eight months ago, Craig Federighi was presenting new iOS 11 features, including HEVC and HEIF encoding for all videos and pictures. While HEVC was already a known buzzword at the time, the way he introduced HEIF and the fact that Apple is the only big company publicly using it can make one think that this "HEVC for pictures" was invented by Apple, even though it is not the case. This gave me the idea to write this short article about HEIF.

This article assumes basic knowledge of image compression (common codecs and encoding modes)

Craig Federighi presenting HEIF to masses

Some key points about HEIF:

  • HEIF (short for High Efficiency Image File Format) is, as its name implies, a file format. I emphasize that because many people incorrectly think that HEIF is a codec, which it is not.
  • Even though the first time it was presented to the masses (the WWDC 2017) was last year, HEIF started being defined in 2013 and was finalized in 2015.
  • As with HEVC, HEIF was made by the MPEG group and is part of MPEG-H: it is the part 12, whereas HEVC is the part 2 and MPEG-H 3D Audio is part 3.

The following types of images can be stored in an HEIF file:

  • images with their corresponding thumbnail
  • image sequences with inter encoding (which is a very interesting point for Live Photos)
  • derived image, a non-destructive edited version of the initial image with support for basic transformations (rotation, cropping, etc.)
  • auxiliary items, including for instance a depth map (which is a very interesting point for the iPhone Plus range)
  • metadata, both EXIF and XMP

We understand easily why Apple decided to adopt HEIF as a replacement for JPEG. Well, replacement might not be the best word here because we didn't tackle the encoding part yet. Inside an HEIF file, images are actually encoded with HEVC or H.264 and thumbnails are encoded in… JPEG!

Last but not least, we must mention file extensions. One can notice that macOS gives the "HEIC" extension to all photos. Apple chose that extension to indicate that an HEIC file is an HEIF file containing HEVC-encoded pictures. As for Live Photos, these are stored with the extension "HEICS", where "S" stands for sequence.

That's it for today, I hope this post made you understand better the differences between HEVC, HEIF and HEIC!