HEIC/HEIF (.heic, .heif)
0
Upvotes
3
Views
0
Downloads
1,249
Words
Description
This skill provides guidance on HEIC/HEIF formats, codecs, features, and cross-platform compatibility.
When to Use
Explain HEIC/HEIF vs JPEG for a project | Check cross-platform compatibility of HEIC images | Assess licensing implications of HEVC in HEIF | Recommend when to convert HEIC to JPEG or AVIF
Use Cases
Explain how HEIC/HEIF differs from JPEG. | Assess cross-platform compatibility on Android and Windows. | Advise when to convert HEIC to JPEG or AVIF. | Evaluate HDR/10-bit support and color profiles.
SKILL.md Content
---
name: heic-heif
description: "This skill provides guidance on HEIC/HEIF formats, codecs, features, and cross-platform compatibility."
metadata:
tags: "technology-and-engineering, image-formats, heic-heif, hevc, compression, cross-platform-compatibility, apple-ecosystem"
source: "https://skilldb.dev/skills/file-formats-skills/heic-heif"
pack: "file-formats-skills"
category: "Technology & Engineering"
---
# HEIC/HEIF (.heic, .heif)
## When to use this skill
Use when the user says things like:
- "Explain HEIC/HEIF vs JPEG for a project"
- "Check cross-platform compatibility of HEIC images"
- "Assess licensing implications of HEVC in HEIF"
- "Recommend when to convert HEIC to JPEG or AVIF"
You are a file format specialist with deep knowledge of the HEIC/HEIF image format, its compression technology, Apple ecosystem integration, and compatibility considerations.
## Overview
HEIF (High Efficiency Image File Format) is a container format standardized by MPEG in 2015 (ISO/IEC 23008-12). HEIC is the most common implementation, using HEVC (H.265) compression for the image data. Apple adopted HEIC as the default photo format on iOS 11 (2017) and macOS High Sierra, driving its rapid proliferation. The format was developed to provide dramatically better compression than JPEG while supporting features like depth maps, Live Photos, image sequences, and auxiliary data. While the container format (HEIF) is open, the underlying HEVC codec is encumbered by patents and licensing fees, which has complicated adoption outside the Apple ecosystem.
## Technical Specifications
- **File extension(s):** `.heic` (HEVC single image), `.heics` (HEVC sequence), `.heif` (generic HEIF), `.heifs` (generic sequence), `.avci` (AVC/H.264 coding)
- **MIME type:** `image/heic`, `image/heif`
- **Compression type:** Lossy or lossless using HEVC (H.265). The HEIF container can also use AVC (H.264), AV1 (which makes it AVIF), or other codecs.
- **Color depth:** 8-bit and 10-bit per channel. 10-bit enables HDR content and wider color gamuts (Display P3, Rec. 2020).
- **Max dimensions:** 8,192 x 8,192 pixels per tile; images can be composed of multiple tiles for larger dimensions
- **Transparency:** Alpha channel supported
- **Animation/Sequences:** Supports image sequences (burst photos, Live Photos), derived images (crops, rotations stored as instructions rather than pixel data)
- **Metadata support:** EXIF, XMP, MPEG-7, ICC color profiles, depth maps, gain maps (for HDR)
- **Container features:** Multiple images in one file, thumbnails, auxiliary images (depth, disparity, HDR gain maps), non-destructive edits stored as derivation instructions
- **HDR:** Supports HDR with gain maps (Apple's approach: SDR base + gain map for HDR-capable displays)
## How to Work With It
### Opening & Viewing
- **Apple devices:** Native on iOS 11+, macOS High Sierra+. Photos, Preview, QuickLook all support HEIC natively.
- **Windows:** Windows 10 1803+ supports HEIC via HEIF Image Extensions (free) + HEVC Video Extensions ($0.99 or free OEM version) from Microsoft Store
- **Linux:** `libheif` library, `heif-convert` command, GIMP 2.10+ with plugin
- **Web browsers:** Safari supports HEIC. Chrome/Firefox/Edge do NOT support HEIC natively in web pages.
- **Android:** Android 10+ can decode HEIC
### Creating & Editing
- **iPhone/iPad:** Default capture format (Settings > Camera > Formats > High Efficiency)
- **Photoshop:** Support added in version 23.2+ (requires OS-level HEVC codec)
- **Lightroom:** Full support for HEIC import and editing
- **libheif:** Open-source encoding/decoding library: `heif-enc -q 50 input.png output.heic`
- **Quality:** Apple typically uses quality ~65-75 for camera captures; this produces visually excellent results at small file sizes
### Converting To/From
- **HEIC to JPEG (macOS):** `sips -s format jpeg input.heic --out output.jpg`
- **HEIC to JPEG (cross-platform):** `magick input.heic output.jpg` (requires HEVC delegate) or `heif-convert input.heic output.jpg`
- **HEIC to PNG:** `heif-convert -q 100 input.heic output.png`
- **Batch (macOS):** `for f in *.heic; do sips -s format jpeg "$f" --out "${f%.heic}.jpg"; done`
- **Python:** `from pillow_heif import register_heif_opener; register_heif_opener(); from PIL import Image; Image.open("in.heic").save("out.jpg")`
- **iPhone auto-convert:** iOS can auto-convert to JPEG when sharing/transferring (Settings > Photos > Transfer to Mac or PC > Automatic)
## Common Use Cases
- iPhone and iPad photo capture (default format since iOS 11)
- Photo libraries on Apple devices (50% storage savings vs JPEG)
- Live Photos (combined still + short video sequence in one file)
- Portrait mode photos (depth map stored alongside main image)
- HDR photography with gain maps
- Burst photo sequences (multiple images in single file)
## Pros & Cons
**Pros:**
- Approximately 50% smaller than JPEG at equivalent perceptual quality
- 10-bit color depth for HDR and wide gamut
- Rich container features (depth maps, Live Photos, sequences, thumbnails)
- Non-destructive edits stored as derivation instructions
- Native support across entire Apple ecosystem
- Supports both lossy and lossless compression
**Cons:**
- HEVC patent licensing creates adoption friction and legal uncertainty
- Poor web browser support (no Chrome/Firefox/Edge support)
- Requires codec installation on Windows
- Not universally supported in image editing tools
- Compatibility issues when sharing with non-Apple users
- Encoding is computationally expensive (slower than JPEG)
- Not suitable for web delivery
- Complex specification makes implementation difficult
## Compatibility
| Platform | Support |
|----------|---------|
| iOS | 11+ (native, default capture format) |
| macOS | High Sierra+ (native) |
| Windows 10/11 | Via Microsoft Store extensions |
| Android | 10+ (decode), varies for encode |
| Safari | Supported |
| Chrome/Firefox/Edge | Not supported for web content |
| Photoshop | 23.2+ |
| Lightroom | Full support |
| GIMP | Via libheif plugin |
## Practical Usage
### Handling iPhone Photos in Cross-Platform Workflows
The most common HEIC scenario: a user or client sends iPhone photos that need to work everywhere. Set up automatic conversion at the point of ingestion:
```bash
# Convert all HEIC files to JPEG, preserving EXIF data
for f in *.heic *.HEIC; do heif-convert "$f" "${f%.*}.jpg"; done
# On macOS, sips is built-in and fast
for f in *.heic; do sips -s format jpeg "$f" --out "${f%.*}.jpg"; done
```
For web applications receiving user uploads, use `libheif` bindings (available for Python, Node.js, Go) to convert server-side before storage.
### Automating HEIC-to-JPEG in Python
```python
from pillow_heif import register_heif_opener
from PIL import Image
import os
register_heif_opener()
for filename in os.listdir("./uploads"):
if filename.lower().endswith(".heic"):
img = Image.open(f"./uploads/{filename}")
img.save(f"./converted/{os.path.splitext(filename)[0]}.jpg", quality=90)
```
### Windows Compatibility
Windows requires two Microsoft Store extensions: "HEIF Image Extensions" (free) and "HEVC Video Extensions" (search for the free OEM version by searching "HEVC Video Extensions from Device Manufacturer" in the Store). Without both, Windows cannot display HEIC files. In enterprise environments, deploy these via MSIX or group policy.
### Working with Live Photos and Depth Data
HEIC files from iPhone can contain embedded depth maps and Live Photo sequences. Extract them with `exiftool`:
```bash
exiftool -b -DepthMap photo.heic > depth.jpg
exiftool -ee -b -PreviewImage photo.heic > livepreview.jpg
```
## Anti-Patterns
**Serving HEIC on the web.** Chrome, Firefox, and Edge do not support HEIC. Always convert to JPEG, WebP, or AVIF before serving to browsers. HEIC is a capture and storage format, not a delivery format.
**Assuming all HEIC files are simple single images.** iPhone HEIC files can contain Live Photos (image + video), depth maps, HDR gain maps, and burst sequences. Naive converters may lose this auxiliary data silently.
**Ignoring EXIF orientation.** HEIC files from iPhones rely on EXIF orientation tags. Tools that strip metadata during conversion may produce rotated images. Always apply orientation before removing EXIF data.
**Using HEIC for cross-platform file exchange.** If recipients might be on Windows, Android, or Linux, convert to JPEG first. HEIC compatibility outside the Apple ecosystem remains inconsistent.
**Batch-converting to uncompressed formats.** Converting a library of space-efficient HEIC files to uncompressed TIFF or BMP defeats the purpose. Convert to JPEG (lossy, small) or PNG (lossless, larger) depending on the downstream need.
## Related Formats
- **AVIF:** Uses the same HEIF container but with royalty-free AV1 codec; better long-term outlook
- **JPEG:** The legacy format HEIC aims to replace; universal compatibility but lower efficiency
- **JPEG XL:** Competing next-gen format with royalty-free licensing and JPEG backwards compatibility
- **WebP:** Google's web-focused format; better browser support than HEIC
- **DNG:** Adobe's open RAW format; used for ProRAW on iPhone alongside HEIC
- **ProRAW:** Apple's RAW format (DNG-based) for users who want maximum editing flexibility