Skip to main content

How to Convert HEIC to JPG on Linux and the Command Line

Convert HEIC to JPG on Linux with heif-convert, ImageMagick or FFmpeg, plus macOS sips and Windows PowerShell. Install commands and batch loops included.

Convert HEIC to JPG

Upload your HEIC file — get JPG instantly

HEIC JPG

Tap to choose your file

or

Supports M4A, WAV, FLAC, OGG, AAC, WMA, AIFF, OPUS • Max 100 MB

Encrypted upload via HTTPS. Files auto-deleted within 2 hours.

How to Convert HEIC to JPG on Ubuntu in 2 Commands

  1. Install the tools: sudo apt install libheif-examples
  2. Convert a file: heif-convert -q 92 photo.heic photo.jpg

For a whole folder, wrap the second command in a loop (see Batch Conversion below). On Fedora the package is libheif-tools.

heif-convert (libheif) — The Fastest Native Tool

heif-convert is a command-line utility from the libheif project — the reference implementation of the HEIF/HEIC format. It decodes HEIC files natively without relying on ImageMagick delegates or external codecs. CleverUtils.com uses the same tool on its servers: HEIC to JPG runs through heif-convert at quality 92, and ImageMagick is used only when an image needs edits such as resizing.

Installation

Install libheif tools for your platform:

Bash
# Ubuntu / Debian
sudo apt install libheif-examples

# Fedora / RHEL
sudo dnf install libheif-tools

# macOS (Homebrew)
brew install libheif

# Arch Linux
sudo pacman -S libheif

Verify the installation:

Bash
heif-convert --version

Basic Conversion

Convert a single file to JPG at quality 92:

Bash
heif-convert input.heic output.jpg -q 92

The -q flag sets the JPEG quality (1–100). Quality 92 is the sweet spot — visually identical to the HEIC original while keeping the file size reasonable.

Batch Conversion

Convert every HEIC file in the current directory:

Bash
for f in *.heic *.HEIC; do
    [ -e "$f" ] || continue
    heif-convert "$f" "${f%.*}.jpg" -q 92
done

The [ -e "$f" ] || continue guard handles the case where no files match one of the glob patterns (e.g., no uppercase .HEIC files exist).

Useful Flags

Flag Description
-q <1-100>JPEG output quality. Default varies by build; always specify explicitly.
--with-exifAlso write the EXIF block to a separate .exif file. JPG output already contains the EXIF data without this flag.
--with-auxAlso save auxiliary images, such as depth maps, as separate files.
-C <value>Set chroma upsampling method: nearest-neighbor, bilinear.

Tip: current heif-convert versions copy the EXIF block (GPS, camera, date) and the color profile into the JPG by default. We checked this on our own server with an iPhone-style test file.

ImageMagick — The Swiss Army Knife

ImageMagick is the most widely installed image processing toolkit on Linux servers. If your system already has it, you may not need anything else — recent versions include libheif as a delegate for HEIC decoding. CleverUtils.com uses ImageMagick only when an image needs extra processing, such as resizing or rotating.

Installation

Bash
# Ubuntu / Debian (with HEIC delegate)
sudo apt install imagemagick libheif-dev

# Fedora
sudo dnf install ImageMagick libheif-devel

# macOS
brew install imagemagick

Check that the HEIC delegate is available:

Bash
magick identify -list format | grep -i heic

If HEIC appears in the output, ImageMagick can read your files directly.

Single File Conversion

Bash
magick convert input.heic -quality 92 output.jpg

Or with ImageMagick 7+, the shorter form:

Bash
magick input.heic -quality 92 output.jpg

Batch Conversion

Bash
for f in *.heic *.HEIC; do
    [ -e "$f" ] || continue
    magick "$f" -quality 92 "${f%.*}.jpg"
done

Advanced Options

ImageMagick lets you resize, strip metadata, or adjust colorspace in the same command:

Bash
# Convert and resize to max 2048px on the longest side
magick input.heic -quality 92 -resize 2048x2048\> output.jpg

# Convert and strip all metadata
magick input.heic -quality 92 -strip output.jpg

# Convert with specific colorspace
magick input.heic -quality 92 -colorspace sRGB output.jpg

FFmpeg — For Video-Oriented Workflows

FFmpeg is primarily a video tool, but it can decode HEIC files if it was compiled with HEVC support. This is convenient if FFmpeg is already part of your pipeline and you want to avoid installing additional tools.

Installation

Bash
# Ubuntu / Debian
sudo apt install ffmpeg

# Fedora
sudo dnf install ffmpeg-free

# macOS
brew install ffmpeg

Conversion

Bash
ffmpeg -i input.heic output.jpg

To set JPEG quality (FFmpeg uses a scale of 2–31, where 2 is best):

Bash
ffmpeg -i input.heic -q:v 2 output.jpg

Batch Conversion

Bash
for f in *.heic *.HEIC; do
    [ -e "$f" ] || continue
    ffmpeg -i "$f" -q:v 2 "${f%.*}.jpg" -y
done

The -y flag overwrites existing output files without prompting.

Note: FFmpeg's HEIC support depends on how it was compiled. Some Linux distribution packages (e.g., ffmpeg-free on Fedora) may lack HEVC decoding due to patent concerns. If you get a decoder error, use heif-convert or ImageMagick instead.

Python — pillow-heif + Pillow

For developers who need HEIC conversion inside a Python application or script, the pillow-heif library adds HEIC support to Pillow (PIL). This is useful for integrating conversion into data pipelines, web backends, or automation scripts.

Installation

Bash
pip install pillow-heif Pillow

Single File Conversion

Python
from pillow_heif import register_heif_opener
from PIL import Image

register_heif_opener()

img = Image.open("input.heic")
img.save("output.jpg", "JPEG", quality=92)

Batch Conversion Script

Python
import os
from pathlib import Path
from pillow_heif import register_heif_opener
from PIL import Image

register_heif_opener()

input_dir = Path("./photos")
output_dir = Path("./converted")
output_dir.mkdir(exist_ok=True)

for heic_file in input_dir.glob("*.heic"):
    img = Image.open(heic_file)
    jpg_path = output_dir / f"{heic_file.stem}.jpg"
    img.save(jpg_path, "JPEG", quality=92)
    print(f"Converted: {heic_file.name} -> {jpg_path.name}")

Preserving EXIF Data

Python
from pillow_heif import register_heif_opener
from PIL import Image

register_heif_opener()

img = Image.open("input.heic")
exif_data = img.info.get("exif", b"")
img.save("output.jpg", "JPEG", quality=92, exif=exif_data)

The exif parameter passes the raw EXIF bytes through to the JPG output, preserving camera settings, GPS coordinates, and timestamps.

macOS Terminal — sips (Built-In)

macOS includes sips (Scriptable Image Processing System) out of the box. It supports HEIC natively because macOS bundles the HEVC codec. No installation required.

Single File Conversion

Bash
sips -s format jpeg input.heic --out output.jpg

Batch Conversion

Bash
mkdir -p converted
for f in *.heic *.HEIC; do
    [ -e "$f" ] || continue
    sips -s format jpeg "$f" --out "converted/${f%.*}.jpg"
done

Note: in our test, sips kept the EXIF data (camera, date, GPS) and the Display P3 profile when converting HEIC to JPEG. It keeps the orientation tag instead of rotating the pixels.

PowerShell (Windows) — ImageMagick Loop

On Windows, ImageMagick provides the most reliable command-line option. Once installed, you can use PowerShell to batch-convert:

Installation

  1. Download the Windows installer from imagemagick.org/script/download.php (choose "Win64 dynamic").
  2. Run the installer and check "Add application directory to your system path".
  3. Open a new PowerShell window and verify: magick --version

Single File

PowerShell
magick convert photo.heic -quality 92 photo.jpg

Batch Conversion

PowerShell
Get-ChildItem *.heic | ForEach-Object {
    magick convert $_.FullName -quality 92 ($_.DirectoryName + "\" + $_.BaseName + ".jpg")
}

This converts every .heic file in the current folder to JPG at quality 92. Original files remain untouched.

Tool Comparison

Tool Platforms Batch Quality Ctrl EXIF Speed*
heif-convert Linux, macOS Yes -q 1-100 By default ~0.3s / file
ImageMagick Linux, macOS, Win Yes -quality By default ~0.5s / file
FFmpeg Linux, macOS, Win Yes -q:v 2-31 No ~0.6s / file
Python Linux, macOS, Win Yes quality= Manual ~0.8s / file
sips macOS only Yes Limited Kept ~0.4s / file
PowerShell Windows Yes -quality By default ~0.5s / file

*Approximate times for a 12 MP iPhone photo (4032 × 3024) on modern hardware. Actual speed varies by CPU, disk I/O, and image complexity.

Quality Settings Explained

Different tools use different quality scales. Here is how to get equivalent output across tools:

Target Quality heif-convert / IM FFmpeg (-q:v) Python (Pillow)
Maximum -q 100 -q:v 2 quality=100
Optimal (CleverUtils) -q 92 -q:v 3 quality=92
Good -q 85 -q:v 5 quality=85
Web-optimized -q 75 -q:v 8 quality=75

Why quality 92? This is the setting CleverUtils.com uses in production. At 92, the converted JPG is visually identical to the HEIC original in normal viewing conditions. Going higher makes files noticeably larger with little visible gain. Below 85, compression artifacts become visible in sky gradients and fine textures.

Don't Want the Command Line?

If you would rather skip installing tools, configuring delegates, and writing shell loops — the converter widget at the top of this page does the same thing in your browser. Upload a HEIC file, get a JPG back in seconds. CleverUtils.com runs heif-convert on its servers at quality 92, so the result matches the first method in this article.

How to Open and View HEIC Files on Linux

  • Image viewers (Eye of GNOME, gThumb): install the heif-gdk-pixbuf package so GTK-based viewers can open HEIC.
  • GIMP: version 2.10.2 and later opens HEIC files directly.
  • File manager thumbnails: the heif-thumbnailer package adds HEIC thumbnails.
  • No install allowed: convert the file with the converter above and open the JPG.

Ready to Convert?

Skip the setup — convert HEIC to JPG online in seconds

HEIC JPG

Tap to choose your file

or

Supports M4A, WAV, FLAC, OGG, AAC, WMA, AIFF, OPUS • Max 100 MB

Frequently Asked Questions

The fastest method is heif-convert from the libheif package. Install it with sudo apt install libheif-examples on Ubuntu/Debian or sudo dnf install libheif-tools on Fedora, then run: heif-convert input.heic output.jpg -q 92. It decodes HEIC natively without depending on ImageMagick delegates.

Yes. The command is simply ffmpeg -i input.heic output.jpg. For best quality, add -q:v 2. However, FFmpeg's HEIC support depends on how it was compiled — some distribution packages lack HEVC decoding due to patent restrictions. If you get a decoder error, try heif-convert or ImageMagick instead, as they are more reliable for this specific task.

Use a shell loop with heif-convert: for f in *.heic *.HEIC; do heif-convert "$f" "${f%.*}.jpg" -q 92; done. This converts every HEIC file in the current directory to JPG at quality 92. On macOS, you can also use the built-in sips command: for f in *.heic; do sips -s format jpeg "$f" --out "${f%.heic}.jpg"; done. For Python, use a script with pillow-heif and Path.glob to process entire directories.

It depends on the tool. Current heif-convert versions copy EXIF into the JPG by default. ImageMagick keeps metadata unless you add -strip. FFmpeg does not copy EXIF into image output. Python with pillow-heif keeps EXIF when you pass the exif parameter to save(). macOS sips kept EXIF in our test.

A quality setting of 92 provides an excellent balance between file size and visual fidelity — this is what CleverUtils.com uses in production. At 92, the converted JPG is visually identical to the HEIC original. Going above 95 makes files much larger with minimal visible improvement. Below 85, compression artifacts become noticeable in detailed areas like sky gradients and fine textures. For web-optimized images where smaller file size matters more, quality 75 is a reasonable lower bound.

Install libheif-examples with apt, then run heif-convert -q 92 input.heic output.jpg. For a folder, loop over *.heic in Bash.

Any GTK viewer such as Eye of GNOME or gThumb works once heif-gdk-pixbuf is installed. GIMP 2.10.2 and later also opens HEIC directly.

More HEIC to JPG Guides

How to Convert HEIC to JPG on Windows 10/11
Convert HEIC to JPG on Windows 10 and 11. Free online converter, HEIF extensions, Photos app, and PowerShell methods.
How to Convert HEIC to JPG on Mac
5 ways to convert HEIC to JPG on Mac: online converter, Preview, Finder Quick Actions, Automator, and Terminal sips.
How to Make iPhone Save Photos as JPG Instead of HEIC
Change iPhone camera format from HEIC to JPG. Most Compatible mode, AirDrop auto-conversion, and converting existing photos.
How to Open & Convert HEIC Photos on Android
Open and convert HEIC photos on Android. CleverUtils in mobile Chrome, Google Photos, and Samsung camera settings.
How to Batch Convert HEIC to JPG
Batch convert HEIC to JPG online or via command line. Mac Finder, PowerShell, and Linux methods for multiple files.
Convert HEIC to JPG from Google Drive & Google Photos
Cloud services store HEIC as-is. Download and convert to JPG from Google Photos, Drive, iCloud, and Dropbox.
What Is HEIC? Complete Guide to Apple's Photo Format
HEIC explained: Apple's HEVC-based image format. 50% smaller than JPEG, 10-bit color, HDR. Compatibility and conversion.
Why iPhone Photos Are HEIC (and How to Change to JPG)
Why Apple switched to HEIC in iOS 11. Change to Most Compatible mode, auto-transfer settings, and batch convert existing photos.
HEIC vs JPG: Which Format Is Better?
HEIC vs JPG compared: file size, quality, 10-bit color, HDR, compatibility. When to keep HEIC and when to convert.
Why HEIC Photos Look Different After Converting (Color Fix Guide)
Fix washed-out colors when converting HEIC to JPG. Display P3 to sRGB color space conversion explained.
HEIC to JPG Quality: Convert Without Losing Quality
JPEG quality levels compared: q=60 vs q=80 vs q=92 vs q=100. File sizes, color profiles, and how to convert HEIC without visible loss.
Back to HEIC to JPG Converter

Request a Feature

0 / 2000