I googled whether HEIC images are lossless or lossy, and whereas some articles and forum threads insist HEIC images are lossy, other insist that HEIC supports both lossy and lossless compression,

but don't provide any details about how to use the latter. I use the latest Ventura, and when I edit HEIC images in Preview (and even if I chose "Lossless" when saving),

enter image description here

their quality degrade. My question is: How can I create lossless HEIC images, that is, the ones that won't degrade when I save and save them again and again?

  • 3
    Preview is a horrible app. If you are concerned about lossy/lossless you are not the user Preview is designed for. Preview is merely to look at* photos and PDFs. It is not, and has never been, remotely capable of quality editing. First, use something better.
    – Scott
    Commented Nov 5, 2023 at 22:50

3 Answers 3


Let me try to address the contradiction if it is lossless or not.

Here is a screen capture of the Gimp dialog when exporting to HEIC. Note the words used: Nealry lossless.

enter image description here

And here is a specific test.

The full method I use is here, (I have not made an updated English version).

  1. The reference image
  2. The HEIC image over the reference test with the "difference" filter, and then levels modified to contrast pixels.
  3. A comparative using a file with some compression.
  4. A graph showing the levels of the comparative file. If the pixels were clamped to the left the "difference" file is totally black, meaning no difference.

enter image description here

On this specific test, using the "Nearly lossless" actually produces an identical copy of the original image. But in some other tests I did, I noticed a small change in the pixels. I need to do more extensive testing.

My conclusion in the first part of the question is that the algorithm can produce a lossless image in some circumstances, and a Nearly lossless on others.

The "official" posture is that it has lossless. https://nokiatech.github.io/heif/technical.html

enter image description here

However, the posture of some implementations is that it does not have a fully lossless compression.

Don't provide any details about how to use the latter

In the case of Gimp, just use the checkbox.

So how to create HEIC images that won't degrade when I edit them?

Here is the real question. Do not use a lossless file format when editing.

There are 3 main types of files used in photography.

  1. The original file. If quality matters you will save a RAW file, which is your original original. In some cases where you forgot to use RAW, or you can not use it, the JPG right out of the camera will be your original.

  2. The editing file. It can be the processing data on a developing software like Lightroom or in some cases the native file format of your editing application. PSD for Photoshop, XCF for Gimp, etc. That is the file format you should use.

  3. The delivery file. When you finish editing your image, you export it to either JPG, HEIC, WebP, PNG, TIF, or whatever format you need.

When you need additional editing, you use your native file format and then export a new delivery file.

Some people use lossless file formats like PNG to work with the files, but if you used layers, masks, etc, you actually will lose them on the "lossless" file.



As @jsx97 mentioned HEIC, Preview and Ventura, most likely meaning macOS Ventura, I'd conclude they're in the Apple ecosystem.

If that's true, then in practice, that means lossy or lossless is a question that really could be asked a lot further upstream - e.g. how is this HEIC image first generated? What exactly is inside that file?

For example, by default out of the box, an iPhone 7 or later would store its photos as lossy HEIC (more precisely as HEVC in an HEIF container, see Apple Support and Wikipedia HEIF). Then perhaps @jsx97 might complete edits in Preview.

So if that's the workflow, I'd intuit that I think @jsx97 really wants to start with Apple ProRAW.

Why? To risk oversimplifying a very nice though very detailed Understanding ProRAW article, lossy compression is applied to an image at Step 3: Optimize, already, so I'd understand why Apple wouldn't attempt to maintain a needlessly lossless workflow beyond that point - lossy and the 10 to 12 times smaller file size is a better trade off for the masses. Then whether it's GIMP, Halide, Lightroom, Photoshop, Preview or something else to edit, it'll have the potential to yield results which lossy/lossless could have a meaningful effect on.

The other clue I see in the screenshot was 38KB for lossless, which is far too small for a photo and suggests some kind of icon or artwork - in which case SVG or PNG as purely lossless image formats could be better intermediate options.

But in truth, we don't know, so I'll speculate no further.

Of course, if @jsx97 clarifies the question, it may yield a better recommendation.

P.S. This might be better on https://softwarerecs.stackexchange.com/


Found on Reddit:

HEIC is a lossless format

Wrong. HEIC is just a container (the C in the name is from Container). However in the way it is implemented by both Samsung and Apple for their pictures IT IS A LOSSY FORMAT with parameters set so as quality of compressed image is marginally better than that from JPG but at about half of the size of the JPG (and even for JPG you have a quality factor, which is usually in the 90-95% range).


So it seems the answer is that HEIC images can be either lossy or lossless, and both LinkedIn and Adobe articles seems to be misleading in this point. But currently the default macOS apps are using lossy HEIC, and to use lossless HEIC you need some professional software (not sure Photoshop does support it) or wait until macOS will use lossless HEIC instead of lossy.

  • 1
    Well. I quoted you the spec, which has both. nokiatech.github.io/heif/technical.html.
    – Rafael
    Commented Apr 23 at 19:05
  • I would argue that the quote is misleading. HEIC is the implementation of images or image sequences of the HEIF compression algorithm. But is not just a container. When you use the term "just a container" it normally implies that you can use different compression algorithms.
    – Rafael
    Commented Apr 23 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.