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

Proper color management with ICC profiles #235

Open
T-3B opened this issue Mar 24, 2024 · 3 comments
Open

Proper color management with ICC profiles #235

T-3B opened this issue Mar 24, 2024 · 3 comments

Comments

@T-3B
Copy link

T-3B commented Mar 24, 2024

It appears that pqiv is ignoring color profiles (ICC).

For example this comparison:
image
Left is the PNG version, and right is a JPG with XYB ICC.
The right part of the screenshot should be identical to the left if there was a proper color management.

Here is the XYB JPG:
xyb

Note that mpv does output the correct colors because it fetches the ICC profile (and MPV uses FFmpeg as pqiv does).
Browsers also support ICC profiles.

I really hope this will be implemented in pqiv.
Thank you very much for this minimalist and keyboard-oriented image viewer, I love it :)

@phillipberndt
Copy link
Owner

pqiv uses GTK's own GdkPixbuf for rendering standard file formats, and it looks like it doesn't really support this:

https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/104

Do any Gnome default viewers get this right for you? If yes I could take a look at how they do this.

Does disabling the gdkpixbuf backend fix this for you?

@T-3B
Copy link
Author

T-3B commented Mar 25, 2024

GdkPixbuf supports ICC profiles.
An example of Gnome viewer supporting this JPG file: "Eye of Gnome"

Does disabling the gdkpixbuf backend fix this for you?
No, as well as disabling everything except wand (ImageMagick)

A "friend of mine" explained me:

the ICC profile is a base64-encoded null-terminated ASCII string icc-profile option key used in gdk_pixbuf_get_option

you can call gdk_pixbuf_get_option("icc-profile") which returns a gchar * string, and then you can use g_base64_decode to get the actual ICC profile buffer which can be fed to lcms2 or something of that form

I don't know many things about all that stuff (sorry), but it feels like it is possible to render this JPG correctly in pqiv.
Thank you for your fast answer!

@T-3B
Copy link
Author

T-3B commented Apr 3, 2024

Don't hesitate to say if the information of the previous message was enough (or not), or if I should redirect you to actual code of a Gnome image viewer supporting ICC profiles. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants