Bug 504227

Summary: Wrong colors
Product: [Applications] Spectacle Reporter: Alberto Salvia Novella <es20490446e>
Component: GeneralAssignee: Noah Davis <noahadvs>
Status: RESOLVED LATER    
Severity: major CC: kde, nate
Priority: NOR    
Version First Reported In: 6.3.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot.png

Description Alberto Salvia Novella 2025-05-14 17:40:13 UTC
SYSTEM
- Zenned
- Plasma 6.3.5 
- Frameworks 6.14.0
- Qt 6.9.0

STEPS
1. Take a screenshot and save it in PNG, AVIF and JPEG.
2. Open the files on Firefox.
3. Go to "about:config" and set "gfx.color_management.mode" to "1" (always manage, instead of only when tagged).
4. Reopen the files.

RESULT
- In the first instance you get wrong colors for: AVIF.
- In the second instance for all.

CAUSE
- The color format or metadata shall be wrong or missing in some way.
- Get the info with: identify -verbose [file]
Comment 1 Nate Graham 2025-05-14 17:57:40 UTC
Can you attach a screenshot that can be used to reproduce the issue?

Do any other images (AVIF or other formats too) exhibit weird colors in Firefox when you turn that option on?
Comment 2 Alberto Salvia Novella 2025-05-14 18:14:14 UTC
Created attachment 181301 [details]
Screenshot.png

You can see that the colors on the screenshot looks de-saturated compared with the real colors.

Firefox may exhibit wrong colors on other kinds of images only if their color-space isn't tagged in the EXIF data.

Then it just assumes the color space. With "gfx.color_management.mode=1" is assumes "sRGB", with "gfx.color_management.mode=2" it assumes the same as your screen (no color management).

This is messy on Firefox too, because "gfx.color_management.mode=1" will use "sRGB" also on instances where it is incorrect. For example the UI of YouTube will look orange.

qView will do the oposite, same with GIMP if color management is turned on. They will assume sRGB instead of the full screen gamut.

So the solution is to always properly tag the color space on the screenshots, with a matching pixel format, so the program that shows the screenshot doesn't make guesses.
Comment 3 Alberto Salvia Novella 2025-05-14 18:32:29 UTC
If you do:
identify -verbose [file]

You see:
Version: ImageMagick 7.1.1-47 Q16-HDRI

Specifically:
HDRI

But:
Colorspace: sRGB
Depth: 8-bit

Which according to the docs:
https://imagemagick.org/script/high-dynamic-range.php

Section:
Enabling HDRI in ImageMagick

May be the wrong mode.
Comment 4 Alberto Salvia Novella 2025-05-15 01:56:31 UTC
I see that many applications misbehave, and only when the screen is calibrated.

I need to further bisect this bug first.