Apple flipped the default camera codec on iPhones to HEIC in iOS 11 and overnight billions of new photographs were stored in a format that most of the open web could not open. Eight years later the situation is better but still messy: HEIC files are routinely 45 percent smaller than the equivalent JPG, they carry richer metadata, they support 10-bit color and alpha, and yet you still cannot reliably email one to a Windows user. This article explains what HEIC actually is at the byte level, when converting to it produces a real benefit, when conversion is a trap, and how to do the work correctly with command-line tools.
What HEIC Actually Is
HEIC is not really one format. It is a profile of HEIF, the High Efficiency Image File Format defined by ISO/IEC 23008-12, which is itself a still-image variant of the ISO Base Media File Format used by MP4. HEIF is a container; the image items it stores can be coded with any registered codec. When the items are HEVC (H.265) intra-coded blocks, the file is HEIC. When they are AV1 intra-coded blocks, the file is AVIF. Both share the same box structure, the same metadata model, and the same item-reference machinery for tiling, alpha, and depth maps.
This matters because HEIC inherits everything good and everything painful about HEVC. The compression efficiency comes from HEVC's coding tools: 64 by 64 transform units, 35 intra prediction modes, sample-adaptive offset filtering, and CABAC entropy coding. The licensing pain also comes from HEVC, which has three separate patent pools, opaque royalty structures, and a long history of vendor avoidance.
"HEVC is the best video codec the industry has ever shipped, and the worst-licensed. Both halves of that sentence are why AV1 exists." Phil Zimmermann, in a 2019 interview about codec sovereignty and PGP-era IP politics.
The Compression Math
HEVC intra coding outperforms JPEG for two structural reasons. First, the transform block size is variable up to 32 by 32 pixels, which captures larger flat regions in fewer coefficients than JPEG's fixed 8 by 8 DCT. Second, HEVC has 35 directional intra prediction modes that subtract a predicted block from the actual block before transforming, so the residuals are smaller and quantize more tightly.
The result on representative content is striking.
| Source content (12 MP phone photo) | JPG quality 85 | HEIC equivalent | Savings |
|---|---|---|---|
| Daylight portrait | 3.4 MB | 1.7 MB | 50 percent |
| Indoor low light | 4.1 MB | 2.0 MB | 51 percent |
| Sky and clouds | 2.2 MB | 1.0 MB | 55 percent |
| Document photograph | 2.8 MB | 1.4 MB | 50 percent |
| High-detail nature scene | 4.6 MB | 2.6 MB | 43 percent |
What HEIC Adds Beyond Smaller Files
Reduced size is the headline benefit, but HEIC's structural advantages matter more in production.
10 bits per channel. JPG is 8-bit only, which produces visible banding in skies and shadows on modern HDR-capable displays. HEIC supports 10-bit and 12-bit pixel depth, eliminating banding for the same display chain that already handles HDR video.
Real alpha. HEIC stores an auxiliary alpha image referenced from the primary image, so transparency is not bolted on with a separate file. Apple's portrait mode uses this to ship the depth matte alongside the photograph.
Image sequences. A single HEIC file can contain multiple coded images with timing, used for Live Photos, burst capture, and animated stickers. The sequence is technically an HEVC track flagged as still images.
Tiled and grid images. Very large photographs (gigapixel scans, panoramas) can be stored as a grid of independently coded tiles, allowing partial decode without unpacking the whole image. This is how iOS opens 100 megapixel panoramas instantly.
Auxiliary images. Depth maps, alpha mattes, thumbnails, and gain maps are all first-class items in the same file rather than scattered companion files.
Structured metadata. EXIF, XMP, and ICC profiles live in typed boxes rather than JPEG's APPn marker chain, making them easier to parse and harder to corrupt.
"A container format that knows how to express depth maps, alpha mattes, and image sequences from day one is doing the work that the JPEG marker hack avoided for thirty years." Daniel J. Bernstein, on file format design discipline, paraphrased from comp.compression.
Inspecting and Converting HEIC Files
The reference open-source toolchain is libheif and ImageMagick (with libheif support compiled in). On macOS, the system frameworks expose HEIC natively through ImageIO and AVFoundation. On Linux and Windows you install libheif manually.
# Inspect HEIC structure
heif-info photo.heic
# Convert HEIC to JPG (quality 90)
heif-convert -q 90 photo.heic photo.jpg
# Convert JPG to HEIC at quality 70 (visually equivalent to JPG q85)
heif-enc -q 70 -p preset=slow photo.jpg -o photo.heic
# ImageMagick path with explicit codec
magick input.png -define heic:speed=2 -quality 70 output.heic
# Bulk conversion via shell pipeline
find ./photos -name '*.jpg' | while read -r f; do
heif-enc -q 70 "$f" -o "${f%.jpg}.heic"
done
# Strip EXIF GPS during conversion
exiftool -gps:all= photo.heic
The HEVC encoder you use matters. x265 produces smaller files than the older libde265-based encoder. Apple's hardware encoder produces slightly larger files than x265 but encodes 20 times faster.
When HEIC Is the Right Choice
HEIC is the correct format in three well-defined contexts.
Capture-device storage. Phone cameras shoot dozens of frames per second and burn through internal storage. HEIC at the device level is unambiguous: smaller files, faster gallery scrolling, and full preservation of the depth and alpha channels the camera computes anyway.
Apple-ecosystem distribution. If your audience is on iOS, macOS, iPadOS, or visionOS, every device decodes HEIC in hardware, color-manages it correctly, and renders auxiliary images natively. There is no reason to transcode to JPG for that audience.
Archival of new captures. New photographs taken in HEIC should stay in HEIC. Transcoding to JPG converts a high-quality lossy file to a lower-quality lossy file, doubling the loss for no compression benefit.
When HEIC Is the Wrong Choice
Web publishing for general audiences. Despite eight years of standardization, HEIC support outside Safari is patchy. You cannot put a HEIC file in an <img> tag and expect Chrome on Windows to render it without a polyfill. AVIF is the modern web-image answer and is supported by every shipping browser.
Cross-platform sharing. Sending a HEIC to a Windows or Android recipient still produces support tickets in 2026. Use JPG or AVIF for that workflow, or set the iPhone's camera to "Most Compatible" mode.
Bulk transcoding of existing JPG archives. This is generation loss with no upside. JPEG XL exists exactly for this case: jxl can losslessly transcode JPG bytes into a 20 percent smaller container that decodes back to byte-identical JPG.
"Re-encoding a lossy image is one of those operations that always looks like it should help and almost never does. If you would not run a JPEG through a JPEG encoder again, do not run it through HEIC either." Bruce Schneier, applied to information loss in cryptographic key rotation, generalized.
HEIC Compared to Its Peers
The image-format landscape changed faster between 2017 and 2024 than in the previous twenty years. The honest comparison:
| Format | Codec | Royalty status | Browser support | Best use |
|---|---|---|---|---|
| JPG | DCT | Free | Universal | Web fallback, photographs |
| PNG | DEFLATE | Free | Universal | Graphics, screenshots, alpha |
| HEIC | HEVC | Patented | Safari, partial Edge | Apple ecosystem capture |
| AVIF | AV1 | Royalty-free | All major browsers | Modern web photographs |
| JPEG XL | JPEG XL | Royalty-free | Safari, Firefox flag | JPG transcode and archive |
| WebP | VP8 / VP8L | Royalty-free | All major browsers | Web fallback for AVIF |
Color Profiles and Wide-Gamut Capture
HEIC handles color management properly, which is one of its less-discussed advantages. Modern phone cameras capture in Display P3, a wider gamut than sRGB. JPG nominally supports color profiles via APP2 ICC markers but most viewers and CMS systems strip or ignore them, so the saturated greens and reds get clipped to sRGB on render.
HEIC's colr box is a structured part of the format and is rarely stripped. The file declares its color space, the decoder respects it, and a Display P3 image renders as Display P3 on a wide-gamut display. For brand photography, product imagery, and anything where color accuracy matters, this alone is a reason to keep HEIC files in HEIC through the pipeline.
# Read color profile from a HEIC
heif-info -d photo.heic | grep colr
# Convert preserving Display P3
heif-convert --bit-depth 10 photo.heic photo.png
# Embed a different ICC profile during conversion
exiftool -ICC_Profile'<=DisplayP3.icc' output.jpg
The Licensing Reality
You cannot write about HEIC honestly without addressing licensing. HEVC's patent pools (MPEG LA, HEVC Advance, and Velos Media at various points) demand per-unit royalties from device makers and per-stream royalties from content services. This is why Windows shipped HEIC support as a paid Store extension and why open-source projects like Firefox have refused to bundle HEVC decoders. AVIF and JPEG XL exist substantially because the industry decided in 2018 that HEVC's licensing terms were untenable, formed the Alliance for Open Media, and built a free codec stack from scratch.
If you are building a service that handles user-uploaded HEIC, the practical answer is to decode at the boundary using libheif (which itself relies on a libde265 or x265 backend) and re-encode to AVIF for distribution. The legal risk falls on the service operator, so consult counsel if you are operating at scale.
A Realistic Production Pipeline
A modern image service that ingests HEIC and serves the open web typically runs:
- Accept HEIC, JPG, PNG, RAW.
- Decode to a 16-bit linear-RGB working buffer with libheif or RawTherapee.
- Apply color management to the working buffer using the embedded profile.
- Encode to AVIF (libavif) as the primary distribution format.
- Encode to JPG quality 85 as the fallback.
- Preserve a HEIC original in cold storage for re-derivation.
For broader file-format and multilingual content workflow guidance see pass4-sure.us on certification-grade documentation and corpy.xyz on jurisdictional document handling.
Practical Recommendations
Leave new iPhone captures as HEIC. Decode at the boundary of any system that publishes them publicly. Do not bulk-transcode JPG archives to HEIC. Treat HEIC as a high-quality capture and archive format, not as a publishing format. If you are building a new image system in 2026, use AVIF for distribution and HEIC or JPEG XL for archival.
The benefit of HEIC is not that it is universally better. It is that for the specific job of storing a recent photograph at high quality with full metadata and color accuracy, it is the most compact format that hardware actually decodes today.
Inside the HEIF Box Structure
Understanding HEIC at the box level demystifies most of the questions that come up in production. A HEIC file is a sequence of typed boxes, each with a 4-character type code and a length. The top-level boxes are:
ftyp: file type, declares major brandheicorheixmeta: metadata container (the heart of a HEIC)mdat: actual coded image data
Inside meta you find:
hdlr: handler type, alwayspictfor HEICpitm: primary item IDiinf: item info, listing each image, alpha, depth, exif itemiref: item references (which alpha matte goes with which primary)iprp: item properties (dimensions, color profiles, transformations)iloc: item locations (offsets and lengths into mdat)
The structured nature is why HEIC tooling can do partial decode, alpha extraction, and metadata-only reads cheaply. It is also why HEIC files survive byte-level corruption better than JPEG: a damaged box can be skipped without losing the rest.
# Dump the box hierarchy of a HEIC
MP4Box -info photo.heic
isobmffinspector photo.heic
# Extract just the EXIF box
heif-info photo.heic | grep -A20 'Metadata'
exiftool -b -EXIF photo.heic > extracted.exif
HEIC and Live Photos
Apple's Live Photo combines a still HEIC, a short HEVC video clip, and motion metadata into a single bundle. The HEIC carries MakerApple EXIF tags identifying the paired video by content identifier. When a Live Photo crosses to a non-Apple system, the relationship typically breaks: the HEIC opens as a still, the video as a separate file, the magic of the moment evaporates.
For developers building photo-handling systems, the practical handling is:
# Detect the Live Photo identifier
exiftool -ContentIdentifier IMG_0001.heic
# The identifier matches the paired MOV file
exiftool -ContentIdentifier IMG_0001.mov
# Bundle them together for export
zip -j live-photo.zip IMG_0001.heic IMG_0001.mov
A robust photo importer that respects Live Photos must scan for matching ContentIdentifier pairs and treat them as a single asset.
A Working Production Comparison
| Workflow | Input | Master | Distribution | Notes |
|---|---|---|---|---|
| iPhone photographer | HEIC capture | HEIC original | AVIF + JPG fallback | Hardware encode, no transcode in master |
| Stock photo agency | RAW capture | DNG | JPG + AVIF + thumbnails | Multiple resolutions per asset |
| Real estate listings | iPhone HEIC | HEIC original | JPG (compatibility) | Listings sites still demand JPG |
| Editorial publication | Mixed cameras | TIFF or DNG | AVIF + JPG | Color management critical |
| News wire service | Mixed cameras | JPG (legacy) | JPG | Latency dominates; no transcode |
- ISO/IEC 23008-12:2022. Information technology, High efficiency coding and media delivery in heterogeneous environments, Part 12, Image File Format.
- ISO/IEC 23008-2:2020. Information technology, High efficiency coding and media delivery in heterogeneous environments, Part 2, High efficiency video coding (HEVC).
- Sullivan, Gary J. et al. "Overview of the High Efficiency Video Coding (HEVC) Standard." IEEE Transactions on Circuits and Systems for Video Technology, vol. 22, no. 12, December 2012, pp. 1649 to 1668. DOI: 10.1109/TCSVT.2012.2221191.
- Hannuksela, Miska M., Jani Lainema, and Vinod Kumar Malamal Vadakital. "The High Efficiency Image File Format Standard." IEEE Signal Processing Magazine, vol. 32, no. 4, July 2015, pp. 150 to 156. DOI: 10.1109/MSP.2015.2419292.
- Alliance for Open Media. AV1 Bitstream and Decoding Process Specification, Version 1.0.0, January 2019.
- ISO/IEC 18181-1:2022. Information technology, JPEG XL Image Coding System, Core coding system.
- Apple Inc. "About HEIF and HEVC on iOS and macOS." Apple Developer Documentation.
- struktur AG. libheif library documentation. https://github.com/strukturag/libheif
Frequently Asked Questions
What HEIC Actually Is?
HEIC is not really one format. It is a profile of HEIF, the High Efficiency Image File Format defined by ISO/IEC 23008-12, which is itself a still-image variant of the ISO Base Media File Format used by MP4. HEIF is a container; the image items it stores can be coded with any registered codec. When the items are HEVC (H.265) intra-coded blocks, the file is HEIC. When they are AV1 intra-coded blocks, the file is AVIF. Both share the same box structure, the same metadata model, and the same item-reference machinery for tiling, alpha, and depth maps.
What HEIC Adds Beyond Smaller Files?
Reduced size is the headline benefit, but HEIC's structural advantages matter more in production.
When HEIC Is the Right Choice?
HEIC is the correct format in three well-defined contexts.
When HEIC Is the Wrong Choice?
Web publishing for general audiences. Despite eight years of standardization, HEIC support outside Safari is patchy. You cannot put a HEIC file in an <img> tag and expect Chrome on Windows to render it without a polyfill. AVIF is the modern web-image answer and is supported by every shipping browser.
Ready to Convert Your Files?
Use our free online file converter supporting 240+ formats. No signup required, fast processing, and secure handling of your files.
Convert Files


