Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colors in QGIS wasm in chromium look less bright (washed out) #9

Open
andreasneumann opened this issue Oct 24, 2023 · 6 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@andreasneumann
Copy link
Member

andreasneumann commented Oct 24, 2023

grafik

It seems like Chrome does some color management which results in slightly dumper (less vivid) colors - when compared to QGIS Desktop and Firefox wasm rendering. One can see at in the blue of the rivers or the orange tones of the polygons above the shaded relief.

This is more an observation and not so much a bug.

@boardend : how to you transfer the rendered images from QGIS wasm to OpenLayers? As a JPEG or PNG encoded file? Can we influence color management in chrome?

@andreasneumann
Copy link
Member Author

andreasneumann commented Nov 8, 2023

Maybe it has to do with the fact that browsers behave differently for images where no color profile is embedded in the image - see this comparison table at https://www.benq.com/en-us/knowledge-center/knowledge/web-browsers-color-management.html

Perhaps this can be fixed by assigning the sRGB color profile to the rendered canvas image ?

Perhaps the above information at the BenQ website is outdated, but it is worth a try if the issue disappears by explicitly setting the sRGB color space to the rendered images, as explained here:

https://stackoverflow.com/questions/69274916/how-to-specify-color-space-for-canvas-in-javascript

@boardend
Copy link
Collaborator

boardend commented Nov 8, 2023

Does setting the chrome://flags/#force-color-profile have an effect on this?

We can try to set srgb on the ImageData returned form the qgis-js API, as well as in the Canvas. (But this will be the default anyways, so in theory it should have no effect...)

PS: On my system (Ubuntu 22.04 with Wayland) the colors in Firefox and Chromium seem to look the same. I will have a go on some Windows machines over the weekend.

@andreasneumann
Copy link
Member Author

andreasneumann commented Nov 8, 2023

Does setting the chrome://flags/#force-color-profile have an effect on this?

Yes - there is a huge difference (on Windows 11). Setting it to sRGB makes the colors the same as in QGIS and Firefox, setting this preference to "Default" results in the washed out colors that I described.

Does this mean that there is nothing we could do here - and it is up to the user setting ?

@andreasneumann
Copy link
Member Author

grafik

The left side is with force-color-profile set to "default", the right side is when set to sRGB

@boardend
Copy link
Collaborator

boardend commented Nov 8, 2023

One can probably also disable HDR in Windows while leaving Chromiums color profile on "default"?

Could you also do a test, what the following snippet prints to the console, if you paste it to the dev tools of FF and Chromium?

console.log("SDR:", window.matchMedia("(dynamic-range: standard)").matches)
console.log("HDR:", window.matchMedia("(dynamic-range: high)").matches)

@andreasneumann
Copy link
Member Author

Chrome 117.0.5938.150 (Official Build) (64-bit Windows):

console.log("SDR:", window.matchMedia("(dynamic-range: standard)").matches)
SDR: true
console.log("HDR:", window.matchMedia("(dynamic-range: high)").matches)
HDR: false

Firefox 117.0.1 (64-Bit Windows):

console.log("SDR:", window.matchMedia("(dynamic-range: standard)").matches)
SDR: true debugger eval code:1:9
console.log("HDR:", window.matchMedia("(dynamic-range: standard)").matches)
HDR: true debugger eval code:1:9

@boardend boardend added bug Something isn't working help wanted Extra attention is needed labels Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants