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.
And here is a specific test.
The full method I use is here, (I have not made an updated English version).
- The reference image
- The HEIC image over the reference test with the "difference" filter, and then levels modified to contrast pixels.
- A comparative using a file with some compression.
- 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.
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.
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.
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.
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.
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.