SUMMARY *** NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** Linear gamma ICC profiles, such as Elle's Rec.2020 profile, return TRC_UNDEFINED when KoColorProfile::getTransferCharacteristics() is called. This is incorrect, as KoColorProfile::isLinear() will happily say yes and getEstimatedTRC() will also return (1, 1, 1). STEPS TO REPRODUCE 1. Instantiate a copy of the following profile: `KoColorSpaceRegistry::instance()->profileFor({}, PRIMARIES_ITU_R_BT_2020_2_AND_2100_0, TRC_LINEAR);` 2. Query getTransferCharacteristics(). OBSERVED RESULT It returns TRC_UNDEFINED. EXPECTED RESULT It returns TRC_LINEAR. SOFTWARE/OS VERSIONS Windows: 10 21H2 macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: 5.64 Qt Version: 5.12.12 ADDITIONAL INFORMATION Commit f662063cf0
I observed this as well, not only on linear, but on any profiles (be it sRGB, rec709, g22, etc). Always returned as TRC_UNDEFINED. The only one that returns a correct value is when Krita creating a synthetic profile (that has a name "Krita [primaries] [trc]"). Noticed this while working on jxl impex. It seems deep in the color registry that transfer characteristics is not set?
Correct, the synthetic profiles are build per-piece (and so the code had access to the transfer curve's characteristics). The ICC ones are treated as binary blobs, and we never tried to actually parse them...
Also see https://invent.kde.org/graphics/krita/-/commit/f2335c36dc85621e0284ecf688621a66f55e67b2 for the 5.1 cherry-pick.
(In reply to amyspark from comment #3) > Also see > https://invent.kde.org/graphics/krita/-/commit/ > f2335c36dc85621e0284ecf688621a66f55e67b2 for the 5.1 cherry-pick. Ah yes that was me. Sorry I used different name and email, idk why I can't log with same gmail here >< probably had to do with old krita/kde forum..? Anyway I digress, that MR didn't fix the TRC though.. only the rgb primaries and whitepoint. TRC parsing is a bit tricky for non-gamma values.. (or complex parametric curve like ICC v4 did).
Oh, apologies, reopening then.
Git commit cf28aa85149ff5f8a07ae7ea3587fd4137bdfa58 by L. E. Segovia, on behalf of Rasyuqa A. H. Committed on 05/12/2022 at 14:06. Pushed by merge-service into branch 'master'. Parse transfer characteristics from ICC profiles Part-of: <https://invent.kde.org/graphics/krita/-/merge_requests/1667> M +50 -0 libs/pigment/KoColorProfile.cpp M +6 -0 libs/pigment/KoColorProfile.h M +2 -1 libs/pigment/KoColorProfileConstants.h M +5 -0 libs/pigment/colorprofiles/KoDummyColorProfile.cpp M +1 -0 libs/pigment/colorprofiles/KoDummyColorProfile.h M +8 -0 plugins/color/lcms2engine/colorprofiles/IccColorProfile.cpp M +2 -0 plugins/color/lcms2engine/colorprofiles/IccColorProfile.h M +40 -4 plugins/color/lcms2engine/colorprofiles/LcmsColorProfileContainer.cpp M +2 -0 plugins/color/lcms2engine/colorprofiles/LcmsColorProfileContainer.h https://invent.kde.org/graphics/krita/commit/cf28aa85149ff5f8a07ae7ea3587fd4137bdfa58
Git commit a8e7dc17424a62041f76a3833eedfe77f8848c44 by L. E. Segovia, on behalf of Rasyuqa A. H. Committed on 05/12/2022 at 14:11. Pushed by lsegovia into branch 'krita/5.1'. Parse transfer characteristics from ICC profiles Part-of: <https://invent.kde.org/graphics/krita/-/merge_requests/1667> (cherry picked from commit cf28aa85149ff5f8a07ae7ea3587fd4137bdfa58) M +50 -0 libs/pigment/KoColorProfile.cpp M +6 -0 libs/pigment/KoColorProfile.h M +2 -1 libs/pigment/KoColorProfileConstants.h M +5 -0 libs/pigment/colorprofiles/KoDummyColorProfile.cpp M +1 -0 libs/pigment/colorprofiles/KoDummyColorProfile.h M +8 -0 plugins/color/lcms2engine/colorprofiles/IccColorProfile.cpp M +2 -0 plugins/color/lcms2engine/colorprofiles/IccColorProfile.h M +40 -4 plugins/color/lcms2engine/colorprofiles/LcmsColorProfileContainer.cpp M +2 -0 plugins/color/lcms2engine/colorprofiles/LcmsColorProfileContainer.h https://invent.kde.org/graphics/krita/commit/a8e7dc17424a62041f76a3833eedfe77f8848c44