Bug 467608 - imported .kra as File Layer has wrong colors
Summary: imported .kra as File Layer has wrong colors
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Color models (other bugs)
Version First Reported In: 5.1.5
Platform: Microsoft Windows Other
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-20 15:05 UTC by Néd Julien É
Modified: 2026-03-04 14:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
screenshot of the observed result in Krita; on the left it's 'insert as new layer' with good colors, and on the right it's 'insert as new file layer' with different colors (461.62 KB, image/png)
2023-03-20 15:05 UTC, Néd Julien É
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Néd Julien É 2023-03-20 15:05:03 UTC
Created attachment 157448 [details]
screenshot of the observed result in Krita; on the left it's 'insert as new layer' with good colors, and on the right it's 'insert as new file layer' with different colors

STEPS TO REPRODUCE
1. have a krita workfile with AdobeRGB profile
2. open an other krita document (either sRGB or AdobeRGB)
3. insert the first file as 'New File Layer'

OBSERVED RESULT
wrong colors
same with 'Convert color space of image layers' unchecked

EXPECTED RESULT
same colors as in the first file

SOFTWARE/OS VERSIONS
Krita 5.1.5
Windows
Comment 1 Halla Rempt 2023-03-30 14:31:03 UTC
Can you please also share the .kra files?
Comment 2 Bug Janitor Service 2023-04-14 03:45:46 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Néd Julien É 2023-04-22 08:47:29 UTC
My files are higher than size limit to upload them here. So, you can download them there:
https://nereusgames.notion.site/Krita-File-Layer-issue-0fc88c684aff434f82bc4a3337268470
Comment 4 Bug Janitor Service 2023-04-23 03:46:02 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 5 Dmitry Kazakov 2026-03-03 12:27:15 UTC
I can confirm the issue. It seems like the file layers get somehow clipped to sRGB
Comment 6 Bug Janitor Service 2026-03-03 14:08:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2669
Comment 7 Dmitry Kazakov 2026-03-03 16:05:36 UTC
Git commit f77c162afd5eb4153bb1b35548dfaf679179a15c by Dmitry Kazakov.
Committed on 03/03/2026 at 16:05.
Pushed by dkazakov into branch 'master'.

Make sure that the color profile of File Layers is handled properly

When importing a mergedimage.png for a File Layer we should
make sure that the color profile is loaded correctly. To do that
we shoudl avoid using a QImage and prefer the native loading
with KisDocument.

The problem is that KisDocument cannot directly load from a
QIODevice, hence we should first extract the merged image
into a temporary file and only then load it.

M  +59   -25   libs/ui/kis_safe_document_loader.cpp

https://invent.kde.org/graphics/krita/-/commit/f77c162afd5eb4153bb1b35548dfaf679179a15c
Comment 8 Dmitry Kazakov 2026-03-03 16:06:24 UTC
Git commit a1bf0294568cdeb8c60f385c74fb8ef209f08e91 by Dmitry Kazakov.
Committed on 03/03/2026 at 16:06.
Pushed by dkazakov into branch 'krita/6.0'.

Make sure that the color profile of File Layers is handled properly

When importing a mergedimage.png for a File Layer we should
make sure that the color profile is loaded correctly. To do that
we shoudl avoid using a QImage and prefer the native loading
with KisDocument.

The problem is that KisDocument cannot directly load from a
QIODevice, hence we should first extract the merged image
into a temporary file and only then load it.


(cherry picked from commit f77c162afd5eb4153bb1b35548dfaf679179a15c)

Co-authored-by: Dmitry Kazakov <dimula73@gmail.com>

M  +59   -25   libs/ui/kis_safe_document_loader.cpp

https://invent.kde.org/graphics/krita/-/commit/a1bf0294568cdeb8c60f385c74fb8ef209f08e91
Comment 9 Dmitry Kazakov 2026-03-04 14:17:52 UTC
Git commit c1b4d7c9c1ae37d691a8bf72ded04bed47f00860 by Dmitry Kazakov.
Committed on 04/03/2026 at 14:17.
Pushed by dkazakov into branch 'release/6.0.0'.

Make sure that the color profile of File Layers is handled properly

When importing a mergedimage.png for a File Layer we should
make sure that the color profile is loaded correctly. To do that
we shoudl avoid using a QImage and prefer the native loading
with KisDocument.

The problem is that KisDocument cannot directly load from a
QIODevice, hence we should first extract the merged image
into a temporary file and only then load it.


(cherry picked from commit f77c162afd5eb4153bb1b35548dfaf679179a15c)

Co-authored-by: Dmitry Kazakov <dimula73@gmail.com>

M  +59   -25   libs/ui/kis_safe_document_loader.cpp

https://invent.kde.org/graphics/krita/-/commit/c1b4d7c9c1ae37d691a8bf72ded04bed47f00860