Bug 452473 - Krita doesn’t use color profile info in WebP files
Summary: Krita doesn’t use color profile info in WebP files
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (other bugs)
Version First Reported In: 5.0.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-10 15:01 UTC by Karl Ove Hufthammer
Modified: 2022-08-18 22:18 UTC (History)
1 user (show)

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


Attachments
WebP image with embedded colour profile (19.85 KB, image/webp)
2022-04-10 15:01 UTC, Karl Ove Hufthammer
Details
Corresponding JPEG version (47.48 KB, image/jpeg)
2022-04-10 15:02 UTC, Karl Ove Hufthammer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Ove Hufthammer 2022-04-10 15:01:43 UTC
Created attachment 148088 [details]
WebP image with embedded colour profile

SUMMARY
Krita seems to interpret WebP files as being in the sRGB colour space even if they contain an embedded colour profile which says otherwise.


STEPS TO REPRODUCE
1. Open the attached WebP image.
2. Look at the colours and in the text in the status bar.

OBSERVED RESULT
The colours look dull and the status bar says ‘sRGB-elle-V2-srgbrc.icc’.

EXPECTED RESULT
The colours should look bright and the status bar should say ‘WideRGB-elle-V2-srgbtrc.icc’. For comparison, open the attached JPEG version of the same image. Here the colours look bright and the correct colour profile is used.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220405
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.2
Kernel Version: 5.17.1-1-default (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-2500 CPU @ 3.30GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2

ADDITIONAL INFORMATION
The application Gwenview handles the WebP image properly, i.e. the colours are shown as bright, which indicates that the profile is correctly embedded.
Comment 1 Karl Ove Hufthammer 2022-04-10 15:02:14 UTC
Created attachment 148089 [details]
Corresponding JPEG version
Comment 2 amyspark 2022-04-10 16:19:40 UTC
Assigning to myself, though the real problem is that libwebp doesn't return the image's bit depth and data type anywhere.
Comment 3 amyspark 2022-06-07 01:10:08 UTC
Update: I have been able to confirm WebP returns BGRA8 data [1].
Additionally, following the advice in the documentation [2], it seems we can read animation *and* metadata with the same refactor!

[1]: https://developers.google.com/speed/webp/faq#why_should_i_use_animated_webp
[2]: https://developers.google.com/speed/webp/docs/container-api#demux_api
Comment 4 Bug Janitor Service 2022-06-08 15:43:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1468
Comment 5 amyspark 2022-08-18 22:18:10 UTC
Git commit a20112786adf89277a19096841335a2239dd455f by L. E. Segovia.
Committed on 18/08/2022 at 20:59.
Pushed by lsegovia into branch 'master'.

webp: implement animation and metadata reading

M  +1    -1    plugins/impex/webp/CMakeLists.txt
M  +294  -92   plugins/impex/webp/kis_webp_import.cpp

https://invent.kde.org/graphics/krita/commit/a20112786adf89277a19096841335a2239dd455f