10
submitted 1 month ago by [email protected] to c/[email protected]

cross-posted from: https://lemmy.world/post/31789585

CSS for Inverting Only Bright Images in Obsidian

Hello, I'm looking for CSS code that can invert only bright images in Obsidian. Could you provide me with a script or guidance on how to achieve this? I'm not familiar with CSS, but I'd appreciate any help or clarification on the process

Thanks in advance

cross-posted from: https://lemmy.world/post/31789585 Please see the cross-post as it is updated.

top 2 comments
sorted by: hot top new old
[-] [email protected] 2 points 1 month ago

CSS by itself cannot determine the colors present in an image element, so you won't be able to write a style targeting all your images.

If you're willing to attach a class to all your bright images, you could use the filter property.

HTML

<img class="invert" src="some-bright-image.jpg" />

CSS


.invert {
  filter: invert(1);
}

[-] [email protected] 1 points 1 month ago
this post was submitted on 22 Jun 2025
10 points (100.0% liked)

CSS

594 readers
1 users here now

founded 2 years ago
MODERATORS