Morphio
Menu

Command Line Convert HEIC to JPG

A practical guide to decoding HEIC and writing JPG output from Python or the command line, with the checks that matter in real applications.

Start with the input and output you need

For a reliable converter, decide what files you accept, how you handle orientation and metadata, what JPG settings you use, and how errors are reported before choosing a library or CLI tool.

Define what your converter should do

Decide whether you accept both .heic and .heif, whether multi-image files matter, what JPG quality you want, and whether metadata should be copied, removed, or handled separately.

Also decide what happens when one file fails. Batch code should report the failed item without making successful files look like failures.

Check the library or tool before you build around it

  • Confirm that it can decode the HEIC/HEIF files you expect to receive.
  • Check orientation and color handling with real camera files.
  • Check how it exposes multiple images or frames if those matter to your application.
  • Check metadata behavior instead of assuming EXIF will be copied automatically.
  • Pin the version you test so a later dependency change does not silently change output.

For decoding support, see the HEIC codec guide. For browser viewing and upload issues, see HEIC in Chrome.

Test with files that expose common problems

  • Portrait and landscape photos for orientation.
  • Files with EXIF or other metadata when metadata matters.
  • Large images and batches for memory and throughput behavior.
  • A deliberately invalid or unsupported file for error handling.
  • Multi-image HEIC/HEIF files if your application claims to support them.

Use the HEIC sample files to check how your viewer or converter handles different inputs.

A simple conversion pipeline

A typical flow is: read the file, decode the HEIC image, apply orientation correctly, convert the pixel data to the target color format, encode JPG, and write the output.

For batches, keep file-level status so one bad input does not hide the results from the rest of the job.

Python convert HEIC to JPG

In Python, choose a maintained HEIF/HEIC decoder that works in your deployment environment, decode the image, and save the result with a JPEG encoder. Check the dependency documentation for supported platforms and licensing.

The same pattern applies in other languages: decode with a HEIC-capable library, normalize the image as needed, then encode JPEG with explicit settings.

Command line convert HEIC to JPG

For CLI conversion, use a HEIC-capable image tool available for your operating system. Test the exact tool and version you plan to deploy before building automation around its command syntax.

In scripts, quote paths, choose output names explicitly, and check the exit status. Do not treat the presence of a .jpg file as proof that every input converted correctly.

Common failure points

If decoding fails, first confirm that the file is actually HEIC/HEIF and that the decoder was built with the required image support. If colors or orientation are wrong, inspect the decode and transform steps before changing JPEG quality.

If metadata disappears, check whether your chosen decoder and encoder expose a way to carry it across. Pixel conversion and metadata copying are separate concerns.

Platform-specific help

For device-specific help, see Windows and Mac.

Keep the implementation predictable

For command-line automation, pin the tool version, make output settings explicit, and test representative files before deployment.

When you need a JPEG copy, convert HEIC to JPG.

Related HEIC guides and tools

Choose the guide or tool that matches what you want to do next.

More related HEIC guides and tools

More HEIC guides for related formats, platforms, and tasks.

Frequently asked questions

Short answers to common questions.