https://bugs.kde.org/show_bug.cgi?id=461975

            Bug ID: 461975
           Summary: Broken EXR and TIFF when exporting from some color
                    spaces
    Classification: Applications
           Product: krita
           Version: 5.1.3
          Platform: Flatpak
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: File formats
          Assignee: krita-bugs-n...@kde.org
          Reporter: mrgeek...@gmail.com
  Target Milestone: ---

Created attachment 153852
  --> https://bugs.kde.org/attachment.cgi?id=153852&action=edit
Test files - source images, broken files and exportation script

SUMMARY
I've made some files with the objective of testing whether Krita (especially
via command-line) is exporting files correctly from all color spaces. When the
KRA file is in certain color spaces, exporting to EXR and TIFF formats creates
broken files. I'm attaching a compressed TAR with all files used for testing,
and with a bash shell script to facilitate exporting all files at once.

STEPS TO REPRODUCE
1. Extract the attached file and enter the Krita-ColorTest folder.
2. On the subfolders, check the bad files generated from conversion; they have
similar names to the corresponding source KRA file in the top-level folder.
E.g. *.exr.kra means a KRA file is bad when exporting to EXR. *.exr+tif.kra is
bad when exporting to both EXR and TIFF.
3. In Krita, make sure the last used export settings for EXR and TIFF don't use
any weird/advanced option that could cause incompatibility. E.g. make sure
exportation will flatten the image. Since there's no command-line flags for
such options, you might have to manually export some arbitrary file just to
make sure the correct settings will be remembered when exporting from
command-line.
4. Make sure Krita GUI is closed before running the command-line, so it doesn't
freeze (bug #460631).
5. Then, you can run the shell script to re-export those files via command
line. They'll be generated next to the source, not on the subfolders.
6. Sometimes exporting from Krita GUI gives a different result from the
command-line (bug!), but this result is still broken for one reason or another.

OBSERVED RESULT
The source KRA files use paint and vector layers.
- Sometimes vector layers aren't exported.
However, even if you convert all layers to paint layers, they'll still be
broken because of other problems:
- No files export alpha channel correctly (result often has opaque background,
sometimes image is totally empty).
- Most files in Gray/Alpha color space export Gray channel incorrectly (often
file is green).
- Some files appear broken in other viewers (in addition to the problems above
when opening in Krita), e.g. some TIFF previews are all messed up in Dolphin.
- Files in "encodedBadly" folder have incorrect colors because the result
expects linear colors but they didn't convert from sRGB, so they're lighter
than the original. This can be seen by inspecting the "0.5" gray in the middle.
Triangle was sRGB gray (should be close to #808080) and circle was linear gray
(should be 0.5f in linear space, equivalent to #bcbcbc); tertiary colors also
use the same logic.

EXPECTED RESULT
Files must look like the original, at least when opening them in Krita (but
preferably also in other apps like Gwenview, GIMP). Colors must correspond too.
If the format doesn't support something, it'd be better to have a lossy or
heavier conversion than a broken or badly encoded file.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 22.10
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 5.19.0-23-generic (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-5300U CPU @ 2.30GHz
Memory: 11.1 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 5500

ADDITIONAL INFORMATION
I don't expect broken images in the color spaces not included in the
attachment. I had made a similar test for 5.1.1 for (pretty much) all color
models, exporting to PNG, EXR and TIFF. However, files are CC0, so feel free
use them and this script method to make conversion tests in Krita development
if desired. Such automated scripts can help testing many files at once, so I
suggest using a similar method to test:
- Whether conversions are breaking files.
- Whether command-line conversions are different from GUI exporting.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to