Krita image editor as a documented multi-layer and compressed format to store edited image : KRA.
From Krita documentation: ".kra is Krita鈥檚 internal file-format, which means that it is the file format that saves all of the features Krita can handle. It鈥檚 construction is vaguely based on the open document standard, which means that you can rename your .kra file to a .zip file and open it up to look at the insides."
As for Gimp XCF, ImageMagick must be able at least to extract layers from this container.
Source code of KRA and ORA to QImage thumbnailers :
https://cgit.kde.org/kimageformats.git/tree/src/imageformats/kra.cpp
https://cgit.kde.org/kimageformats.git/tree/src/imageformats/ora.cpp
In fact, the KRA container is a zip like compressed tree with all layers stored with PNG data. ORA sound like very similar.
Very interested in OpenRaster (.ora) as a potential open alternative to PSD so would like this very much.
The spec: https://www.freedesktop.org/wiki/Specifications/OpenRaster/
Update on this issue: OpenRaster 0.2 and above decoder support is merged. It only extracts the mergedimage.png from the file, so extracting layers is not yet supported and is future work that need to be done. I'll look at the Krita format to see how similar it is to OpenRaster.
.kra files have a mergedimage.png too, so I guess it should work as is. (From what I know thus, the mergedimage do not retain the color profile).
Was able to get documentation on the KRA format from freenode: https://invent.kde.org/documentation/docs-krita-org/-/merge_requests/105/diffs. mergedimage.png is optional in Krita (it is not present in auto-saves or backups), but will almost always be present in the "main" Krita file (since 2014).
From the doc: " The format of the pixel data
is internal to Krita and dependent on the version of Krita and can change
without warning.", which means extracting layer data is basically a no-go and the best we can do is extract mergedimage.png, or else preview.png if it does not exist (in the case of backups/autosave)
Most helpful comment
Update on this issue: OpenRaster 0.2 and above decoder support is merged. It only extracts the mergedimage.png from the file, so extracting layers is not yet supported and is future work that need to be done. I'll look at the Krita format to see how similar it is to OpenRaster.