1
\$\begingroup\$

.heic images, as far as I know, can be either lossy or lossless, the same as .tiff or .webp ones.

Is it possible to discover whether a certain .heic image is lossy or lossless? I already tried

  • Bash/Zsh's file image.heic
  • ImageMagick's magick identify image.heic,
  • and ExifTool's exiftool image.heic and exiftool -compression image.heic,

but none works for me.

I really need lossless .heic images in my work. That is, when I open such a file, edit it, save, close, and repeat these steps again and again, the quality should not decrease. But I cannot find neither an app/util to produce them (yes, macOS apps can create .heic files, but it seems they are always lossy), nor even an app/util to discover whether a certain .heic image is lossless or lossy.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ How certain are you that your editing is not converting the histogram distribution through manipulations going over 8-bit to 16-bit or 32-bit and back? IOW, perhaps you are starting with a lossless .heic but degrading image quality not due to lossy compression but rather due to histogram rounding on the color scale. As others have said, it bears repeating, until you use an app that is of higher quality than Preview, it seems you may be chasing the wrong problem. \$\endgroup\$ Commented May 14 at 3:39
  • \$\begingroup\$ @JeffreyJWeimer Thanks, this is really useful to know. \$\endgroup\$
    – jsx97
    Commented May 14 at 8:07
  • \$\begingroup\$ TIFF can be lossless or lossy BUT you should have control of that choice. TIFF is a "container" and it can carry eg JPG files which are lossy. Don't do that :-) . || You MAY find lossless PNG suits you better. Or not. \$\endgroup\$ Commented May 19 at 10:56

1 Answer 1

1
\$\begingroup\$

The file type .heic is merely a container; it is neither lossy nor lossless. What makes it "lossy" is the compression that is applied during the saving of the file. The original .heic may have been created in a lossy, or lossless manner, but you usually have no control over that.

The preview app on mac allows for lossless compression, and I believe Gimp does as well. FWIW, Preview isn't very good for editing...

enter image description here

But that does not mean that the edits are non-destructive. If you apply an edit that is also "lossy." I.e. if you make a detail that was almost white actually white, the information it had previously is lost. The only way to keep it lossless and non-destructive is to apply the edits as layers and export the edited file with the layers still separate (tiff/png).

\$\endgroup\$
1
  • \$\begingroup\$ As far as I can remember, the word "Lossless" here is misleading. The file is actually saved/exported as a lossy one, and this can be proven visually, using many "open-edit-save-close" cycles. I asked a similar question in November at Graphic Design, #162647, and to quote myself: "When I edit HEIC images in Preview (and even if I chose "Lossless" when saving), their quality degrade [over 'open-edit-save-close' cycles]" \$\endgroup\$
    – jsx97
    Commented May 8 at 22:10

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