Created attachment 120900 [details] Test .kra file SUMMARY Multiple layers in tiff seem to work... if all the layers are of the same colorspace or if all the layers are of supported colorspaces (I don't know which one is the case). Otherwise the content is skewed or missing or lost and all the layers have the same colorspace. STEPS TO REPRODUCE 1. Open the attached file. 2. Save as tiff (don't flatten, yes, save ICC profile). 3. Open the file in another tab. 4. Convert the bottom layer colorspace to the same as the top one (XYZ, but I don't remember the bit depth). 5. Save as tiff (the same options). 6. Compare the results with .kra and with the tiff file saved previously. OBSERVED RESULT File saved in 2. looks differently; doesn't have the pink stroke. EXPECTED RESULT All files look at least similar to each other, no content is missing. (The tiff file saved in 5. is different from .kra, but that's because of the colorspace conversion; you'll see the same results if you convert the image colorspace in .kra file to the colorspace tiff exporter converted to). SOFTWARE/OS VERSIONS Linux Mint Qt Version: 5.12.3 ADDITIONAL INFORMATION Using Krita git master 0893c1a784
I guess that we'd best convert every layer to the image colorspace if the layer colorspace is different. I don't think tiff actually supports heterogenous images.
I am setting this to confirmed, given two developers seem to agree it is a bug that is being buggy.
(In reply to Halla Rempt from comment #1) > I guess that we'd best convert every layer to the image colorspace if the > layer colorspace is different. I don't think tiff actually supports > heterogenous images. I have read the standard differently. The specification ICC.1:2010 (Profile version 4.3.0.0) (http://color.org/icc_specs2.xalter) says: "A TIFF file may contain more than one image, and so, more than one IFD. Each IFD may have its own embedded profile. Note, however, that Baseline TIFF readers are not required to read any IFDs beyond the first one." So it should be able to assign different ICC color profiles to layers and KRITA's TIFF export should embed individual ICC color profiles to all TIFF pages, if assigned profiles differ. TIFF import should idealy respect individual color profiles for all pages. If importing a multi-page TIFF where only the first page has an embedded color profile, the TIFF import should apply this color profile to all TIFF pages (layers).
(In reply to ch-bartz from comment #3) > (In reply to Halla Rempt from comment #1) > > I guess that we'd best convert every layer to the image colorspace if the > > layer colorspace is different. I don't think tiff actually supports > > heterogenous images. > > I have read the standard differently. The specification ICC.1:2010 (Profile > version 4.3.0.0) (http://color.org/icc_specs2.xalter) says: > > "A TIFF file may contain more than one image, and so, more than > one IFD. Each IFD may have its own embedded profile. Note, however, > that Baseline TIFF readers are not required to read any IFDs beyond the > first one." > > So it should be able to assign different ICC color profiles to layers and > KRITA's TIFF export should embed individual ICC color profiles to all TIFF > pages, if assigned profiles differ. > > TIFF import should idealy respect individual color profiles for all pages. > If importing a multi-page TIFF where only the first page has an embedded > color profile, the TIFF import should apply this color profile to all TIFF > pages (layers). Can confirm; see the TIFF v6 standard, page 16, last paragraph, then page 101, 3rd paragraph of the current ICC.1:2010.
Hm, upon reading the log, it's not that they aren't saved correctly, on loading the KisDocument applies a single colorspace and ICC profile to the entire image.
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1019
Git commit 6ce9aadc4b1e4584d0cf5730c481c4663f6ac7cc by L. E. Segovia. Committed on 27/08/2021 at 01:31. Pushed by rempt into branch 'master'. TIFF: initialize the layer being read with its IFD's color space M +1 -1 plugins/impex/tiff/kis_tiff_converter.cc A +- -- plugins/impex/tiff/tests/data/results/multilayercs.tif.png A +- -- plugins/impex/tiff/tests/data/sources/multilayercs.tif https://invent.kde.org/graphics/krita/commit/6ce9aadc4b1e4584d0cf5730c481c4663f6ac7cc