Bug - subpixel rendering in dark mode reader
Hi, when using dark mode for content in Zotero 7.0.8 on Ubuntu 24.04 I noticed that the letters are harder to read than usual and look like they have colored outlines. I think this bug comes from not properly handling subpixel rendering. Specifically, I think Zotero is rendering PDFs as usual (in light mode) to a buffer, then inverting that buffer.
See the following images for comparison. This will be more visible if you zoom in. In light mode, which is correctly rendered, you see red outlines on the left side of letters and blue outlines on their right sides (first image, PDF in Zotero light mode). A properly rendered dark mode is the opposite: blue on left, red on right (second image, from a dark website rendered by firefox). In Zotero dark mode what you see instead is blue on right, red on left (third image).
https://s3.amazonaws.com/zotero.org/images/forums/u6779123/0e5dhix44mrcqgoycse0.png
https://s3.amazonaws.com/zotero.org/images/forums/u6779123/up5dmrvq5k175b6snhfi.png
https://s3.amazonaws.com/zotero.org/images/forums/u6779123/fnza2wtwrcqfjh6bjd7w.png
Are there any plans to look into this?
I think the best way to fix it would be to render the PDFs directly in dark mode, leaving the question of correctly handling subpixels to the rendering library. You could also use this opportunity to lower the contrast of dark mode (since the whole point of dark mode is to make it easier on the eyes at night). I will try looking into the code and submitting a patch if I get the time...
Thank you
See the following images for comparison. This will be more visible if you zoom in. In light mode, which is correctly rendered, you see red outlines on the left side of letters and blue outlines on their right sides (first image, PDF in Zotero light mode). A properly rendered dark mode is the opposite: blue on left, red on right (second image, from a dark website rendered by firefox). In Zotero dark mode what you see instead is blue on right, red on left (third image).
https://s3.amazonaws.com/zotero.org/images/forums/u6779123/0e5dhix44mrcqgoycse0.png
https://s3.amazonaws.com/zotero.org/images/forums/u6779123/up5dmrvq5k175b6snhfi.png
https://s3.amazonaws.com/zotero.org/images/forums/u6779123/fnza2wtwrcqfjh6bjd7w.png
Are there any plans to look into this?
I think the best way to fix it would be to render the PDFs directly in dark mode, leaving the question of correctly handling subpixels to the rendering library. You could also use this opportunity to lower the contrast of dark mode (since the whole point of dark mode is to make it easier on the eyes at night). I will try looking into the code and submitting a patch if I get the time...
Thank you
-
martynas_bThanks for the observations. We’re working on a better dark mode that should address your mentioned issues.