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.
Created attachment 148089 [details] Corresponding JPEG version
Assigning to myself, though the real problem is that libwebp doesn't return the image's bit depth and data type anywhere.
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
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1468
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