PDF Smart Invert - Don't invert pictures while in Dark Mode

Use case or problem

I use Obsidian mainly to read scientific papers and material related to my studies (medicine). To limit eye straining, I use dark mode both in the Obsidian interface and in the PDF Viewer. The only problem with this workflow is that pictures / diagrams present in the PDF also have their colors inverted, which can be problematic in scenarios which require accurate color representation (ex: reading radiographs, characterizing skin lesions,…)

Proposed solution

I propose that Obsidian implement a “Smart Invert” for PDFs akin to what is found on Apple Devices. This could be an optional setting that the user could activate if desired. Activated, this setting would invert PDF background colors and text, while keeping original colors for pictures and diagrams.

Here is a visualization of what Smart Invert could look like:

1 Like

I would think this is a bug. I am not as aware of PDF viewers but I would assume (now we all know what that makes us) that the behavior would be to invert the coloring of the Background and text but keep pictures the same coloring. Yes, this means that any jpg or png files without a transparent background would end up having large white boxes around them, but I feel that is a price worth paying.

1 Like

I dont know if the behaviour is a conscious decision by the design team to improve visual uniformity across the PDF or if it is an unexpected side effect. I tried inverting the PDF both wiht a CSS snippet (source: Night Mode for PDF Viewer - #8 by avril) and with the Style Settings plugin (using Minimal Theme). Overall, the results are better with the Minimal Theme than with the CSS snippet (Minimal theme only inverts luminosity values, not color values). Maybe a workaround could be achieved with a more targeted CSS snippet.



What exactly would you need?

  • original colours, but less bright (pictures)
1 Like

I would like the PDF background and text to be inverted while the images keep their original colors / luminosity. That would correspond to the Smart Invert image/concept shown in my original post.

Hmm, usually I don’t read pdfs in Obsidian, so i can’t judge if the pdf viewer got an update in its latest version (v 1.4.13 here). Css snippets seem not that powerful to be able to modify pdf embeds.

I am able to view pdfs with the text body inverted, with exclusion of the images.

But you’ve to activate adapt to theme first. You’ll find this option clicking on the arrow symbol next to the zoom-in button in the pdf viewer. I tested this on a default vault.

2 Likes

That resolved my problem! It looks like my Style Settings were overriding the default PDF dark mode, which explains why images’ colors were inverted. Thanks a lot for your help :blush:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.