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

[Bug] when switching to dark mode, image colors also get inverted #171

Closed
dangmoody opened this issue Mar 30, 2022 · 17 comments
Closed

[Bug] when switching to dark mode, image colors also get inverted #171

dangmoody opened this issue Mar 30, 2022 · 17 comments

Comments

@dangmoody
Copy link

If I view the following image in light mode:
image

When switching to dark mode, the image displays like this:
image

This specific image is a good test case because the skeleton on the right benefits from being shown in contrast to the background color whereas the image of the monster on the left does not.

In my test case Sioyek boots in light mode by default.

@ahrm
Copy link
Owner

ahrm commented Mar 31, 2022

I don't consider this a bug. The alternative would be to automatically detect images and don't invert them. But that would cause a giant white rectangle in the middle of dark mode which I think is pretty undesirable. Or is there any other behavior you have in mind?

@Twix53791
Copy link

I leave here a comment on this behavior. Personally, I found it annoying. At least an option should be available in the config to choose between the two behavior. The best would be to fill just the white background on the images, but not the other colors, but it is maybe impossible. The problem to invert colors appears critical on some graphics using specific colors, worse, which a legend (if the colors don't match...), or for example a map again with colors which can become really weird with inverted colors...

@xulongwu4
Copy link

@Twix53791, maybe you can use the custom_background_color and custom_text_color options, which in my experiment change the image colors a little bit, but not as dramatic as flipping them.

@fossimprove
Copy link

Is there any option like to keep hue?
Zathura has this option set recolor-keephue "true" which keeps the reversing of colors to some readable level.
If so, i would like to request to try to keep hue !

Thank you again!

@ahrm
Copy link
Owner

ahrm commented Apr 22, 2022

Is there any option like to keep hue? Zathura has this option set recolor-keephue "true" which keeps the reversing of colors to some readable level. If so, i would like to request to try to keep hue !

Thank you again!

Have you tried toggle_custom_color and setting custom_background_color and custom_text_color in your prefs_user.config? In that mode we try to somewhat keep the hue.

@fossimprove
Copy link

I have set custom_background_color 0.0 0.0 0.0 custom_text_color 1.1 1.1 1.1

When i toggle the whole pdf gets black white (which is better rather than reversing of color) but no color hue is kept, only black white.

@ahrm
Copy link
Owner

ahrm commented Apr 25, 2022

I changed the dark mode algorithm in 8cf94f9 to try to keep the hue. I don't know if it is much better than previous algorithm though because some JPG compression artifacts are very visible in this mode.

@xulongwu4
Copy link

xulongwu4 commented Apr 25, 2022

I haven't tried the new algorithm, but the old algorithm for keeping the hues works very well for me. I guess the reason is that I don't use pure white/black as cutom text/background colors.

This is my custom color setting (using the famous nord color template):

custom_background_color 0.180 0.204 0.251
custom_text_color 0.847 0.871 0.914

This is the result after toggling custom color on:
Screenshot_20220425_095058

For comparison, this is the original plot with the default background/color settings:
Screenshot_20220425_095127

The color hue changed a little bit (I kind of like the new color hue in the custom color mode to be honest), but you can still tell one is blu-ish, and the other one is red-ish.

@fossimprove
Copy link

I tried with xulong's nord custom colors, it worked decently as stated.
Then i updated to new commit, the new algorithm works better than the previous dark mode. In some pictures, colors are maintained as it is.
This is now perfectly readable in dark mode.

Thank you for working on new algorithm!
You are the BEST!!!

@amzon-ex
Copy link

amzon-ex commented May 1, 2022

Hi!

I'm on Release v0.31.314 and some colours seem to completely vanish when I use dark mode:


Original

sioyek-white


Dark

sioyek-dark


Custom colours

sioyek-custom


As you can see, when I use "custom" colours, the colours are quite faded, which is an issue, but in dark mode, they completely vanish (such a problem didn't exist on the stable version from this repo.)

@ahrm
Copy link
Owner

ahrm commented May 2, 2022

I changed the algorithm again in dc05477. Should be fixed now.

@amzon-ex
Copy link

amzon-ex commented May 2, 2022

Thanks, @ahrm !

I tried it out, and now it seems like I can see the blue curve, but since it's very dark, there's no contrast against the dark background, hence it's as good as invisible:

sioyek-dark-2

(Same with the red dotted curve, but that's comparably better)

@dangmoody
Copy link
Author

dangmoody commented May 3, 2022

I don't consider this a bug. The alternative would be to automatically detect images and don't invert them. But that would cause a giant white rectangle in the middle of dark mode which I think is pretty undesirable. Or is there any other behavior you have in mind?

Hey, sorry for the late response. I've been busy.

After having thought about it I personally would want the image backgrounds to still be light. I look at graphics papers so it would get confusing to be looking at a figure where the paper is describing the red signal/portions of an image only for dark mode to be inverting the colors and not showing a red signal, for instance.

@dvchoudh
Copy link

dvchoudh commented Jul 4, 2022

I don't consider this a bug. The alternative would be to automatically detect images and don't invert them. But that would cause a giant white rectangle in the middle of dark mode which I think is pretty undesirable. Or is there any other behavior you have in mind?

@ahrm I would love this feature, and I don't think users would hate it that much if there is an option to toggle this feature. Just like the above post, I happen to see a lot of graph papers, and this feature would be incredibly helpful. Appreciate if you can implement it :)

@seblj
Copy link

seblj commented Oct 23, 2022

I just tried out sioyek and found it really good, but I also found the colors on pictures with custom colors to be less visible compared to for example zathura with the hue option set.

sioyek:
image
image

zathura:
image
image

Are there any options that I am missing that could make this more vibrant like in zathura?

Version: 1.5.0 of sioyek

@ahrm
Copy link
Owner

ahrm commented Oct 23, 2022

No.

@ahrm
Copy link
Owner

ahrm commented Dec 29, 2022

This is fixed in the latest version of sioyek.

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

8 participants