Obsidian Plugin.
Apply filters, such as darkmode effects (with transparency), to your markdown image links.
This is what it might look like:
-
Add the plugin
-
Just add the filters to the alias part of your image link:
Normal embed:
`![[image.png|image-description]]`
Embed with darkmode:
`![[image.png|image-description @darkmode]]`
Where darkmode is essentially just a shorthand for this:
`![[image.png|image-description @invert @transparent(threshold="rgb((13, 13, 13))", remove="below") @boost-lightness(amount=1.2)]]`
The filter are applied in order left to right.
will look like this for most cases:
@filter-name(boolean-param, int-param=42, float-param=-6.9, string-param="text-value")
For string values, the following characters have to be written in a special way:
"
=>""
(
=>((
)
=>))
Backslashes are not allowed. (Due to how the image-alt is parsed by obsidian.)
All kind's of link notation are supported:
![[image.png | image-description @darkmode]]

<img src="image.png" alt="image-description @darkmode" style="height: 410px">
You can even use image links to remote images:

(Note that this requires a network request to fetch the image data.)
Reccomended for use on images with white backgrounds (e.g. screenshots of diagrams in papers). Invertes the image, removes the background, and boosts the lightness by 1.2
Essentially just a shorthand for: @invert @transparent(threshold="rgb((13, 13, 13))", remove="below") @boost-lightness(amount=1.2)
.
name: @darkmode
params: none.
Inverts the image.
name: @invert
params: none.
Converts the image pixel representation to hsl, and boosts the lightness.
name: @boost-lightness
params:
amount
:- float-value: the amount by which to boost the lightness.
Make pixels below or above a certain threshold transparent.
name: @transparent
params:
remove
:- string-value: can be either
"above"
or"below"
- if
"above"
: removes pixels above the threshold - if
"below"
: removes pixels below the threshold
- if
- string-value: can be either
threshold
: all pixels that haver
,g
andb
channels above or below this threshold will be made transparent.
Feel free to open pullrequests or issues. Adding new filters is really straight forward, you can use existing filters for reference.
I don't use Obsidian Mobile myself, so if you want mobile support, feel free to open a PR.
Works with
Known issues:
- none so far