lose-memory280 downloadsCustomize Obsidian background with a local image folder: only the currently used image is loaded into memory, supports folders outside the vault, fixed-interval auto rotation and manual random switch. Does not modify theme variables.
A community plugin for Obsidian that puts your own images behind the workspace.
English · 中文
The background model — opacity, blur, size modes, blend modes and the folder-based random rotation — follows vscode-background-cover, minus its particle effects, desktop pet and online gallery. The Obsidian-side layering approach was informed by obsidian-dynamic-theme-background.
The point of this plugin: your background folder can hold thousands of images (5,000+, tens of GB). Only the one image currently on screen is ever read into memory. The folder itself is scanned for file names only, so library size does not affect performance.


The plugin follows Obsidian's own language setting: Chinese UI on Chinese installs, English everywhere else. The screenshots above show a Chinese install.
Two local folders you can switch between
d:\wallpapers)~ (home directory) and ${ENV} / $ENV environment variablesMemory-friendly by design
No-repeat shuffle rotation
VS Code-style appearance controls
auto (multiply on light themes, lighten on dark themes, switching instantly with the theme), multiply, lightenRotation
Zero conflict with themes
bgc-). It does not modify any theme CSS variable (--background-*, --text-*, …) and does not override theme stylesOnce the plugin has been reviewed and published, search for Background Cover in Settings → Community plugins → Browse.
Download main.js, manifest.json and styles.css from the latest release.
Put them in a folder named background-cover inside your vault:
<Vault>/.obsidian/plugins/background-cover/
├── main.js
├── manifest.json
└── styles.css
Reload Obsidian and enable Background Cover in Settings → Community plugins.
The folder name must match the
idinmanifest.json(background-cover).Desktop only. The plugin sets
isDesktopOnly: truebecause it reads image files through Node'sfs, which does not exist in the mobile app.
Open Settings → Background Cover.
| Setting | Description |
|---|---|
| Enable background | Master switch. Turning it off removes everything the plugin adds — the background layer, theme transparency and both dividers — and does not change any theme setting of its own. |
| Active playlist | Which of the two playlists the background, the status bar button, Change background and auto rotation take images from. |
| Folder (Playlist A) / Folder (Playlist B) | One absolute image path per playlist. Supports ~ and environment variables, and may point outside your vault. The folder is scanned as soon as you enter a path. |
| Image sizes | Scan reads the header of every image in the active playlist's folder, reports how many are landscape / portrait at the current threshold, and caches the result. Only headers are read — no image is decoded — and a rescan re-reads only new or changed files. |
| Only use images at or above the aspect ratio | Filter the folder down to images wider than the threshold, so a mixed folder never shows a cropped vertical shot. Images whose size is unknown are skipped, so run a scan first (turning the filter on starts one automatically). |
| Aspect ratio threshold | Width ÷ height, default 1.3 (about 4:3). It also defines which images count as portrait for the vertical position below. |
| Background opacity | Opacity of the background layer, 0 – 0.8 (default 0.2). |
| Background blur | Blur radius in pixels, 0 – 100 (default 0). |
| Size mode | cover (fill, keeps aspect ratio) / contain (stretch to fill, distorts) / center (scale to fit, centered) / repeat (tile) / natural-size positions. |
| Portrait image vertical position | 0 shows the top of a portrait image, 100 the bottom, 50 the middle (default). Only images below the aspect ratio threshold are moved, and only in cover mode — a landscape image is never repositioned. |
| Blend mode | auto (follows the theme) / multiply / lighten. Only applies while the wallpaper is an overlay (theme transparency off); once it is the background layer there is nothing left to blend with. |
| Fade transition | Crossfade smoothly when the image changes (on by default). |
| Make theme background transparent | Makes the theme's opaque background colors transparent and drops the wallpaper below the interface, so the UI and the image stop blending into each other. The only feature that overrides theme colors, off by default — see below. |
| Title bar divider | A 1 px line between the title bar and the workspace (requires the setting above). |
| Sidebar divider | A 1 px line between the sidebars and the workspace (requires the setting above). |
| Divider color | Color of both lines, default neutral gray #808080. |
| Divider opacity | Opacity of both lines, 0 – 1 (default 0.45). |
| Change image on startup | When on, a random image is picked on every launch. When off (default), the image from your last session is restored. |
| Enable auto rotation | Change the background at a fixed interval, off by default. |
| Rotation interval (seconds) | Interval between automatic changes, minimum 5 seconds. |
| Change background now | Immediately take the next image from the active playlist. |
| Copy file name | Puts the file name of the image that is on screen right now on your clipboard — the name only, not the full path. |
A 🖼 button in the status bar changes the image with one click.
"Random" is not an independent draw each time — it is a shuffled playback list:
If your folder genuinely contains only 2–3 images, "no repeats within a round" will feel like cycling between them — that is a property of the library, not the plugin.
This section describes exactly what the plugin accesses and why. It is required disclosure, not marketing.
d:\wallpapers, not inside the vault. The plugin reads that folder's file names, then reads a single image file when it is displayed. A Scan additionally reads the first bytes of each image to learn its size — the header only, never the pixels. It never writes to that folder, never deletes anything, and never scans folders you did not configure.data.json, and image-index.json — the scan cache, a file name → width/height map used so a rescan only re-reads what changed. It contains no image data, and deleting it merely means the next scan starts from scratch.By default the plugin only adds a background. It does not touch any theme variable — the single exception is the optional Make theme background transparent, which is off by default. It never changes your app's appearance or theme setting.
The background layer has two modes, and the difference matters:
position: fixed full-screen overlay composited over the workspace content with mix-blend-mode (the same default effect as vscode-background-cover), at z-index: 20 — above the workspace and the window background bars (Obsidian's --layer-cover 5 / --layer-sidedock 10 / --layer-status-bar 15) and below floating panels (--layer-modal 50 / --layer-notice 60 / --layer-menu 65 / --layer-tooltip 70). Menus, the command palette, notices and hover previews are therefore never tinted by the wallpaper and always look exactly like the theme. Because it is an overlay, the theme's own opaque background colors cannot hide the image, so no theme variable has to be rewritten. The trade-off is that the blend mode composites the wallpaper with everything behind it, interface content included (see below).z-index: -1 and the blend mode is forced to normal, so the wallpaper is composited with nothing but the workspace base color (pure black on dark themes, pure white on light themes). Text, panels and controls are then painted opaquely on top of it: they keep their own colors, and none of them is pulled into the image. body carries contain: strict in Obsidian's own stylesheet, which makes it a stacking context — that is what lets a z-index: -1 child sit above the base color and below the whole interface. This mode needs the theme's opaque surfaces to be transparent, which is exactly what the setting does; that is why the two go together.Obsidian's floating layers are unaffected in both modes: menus, notices, the command palette and modals keep their own opaque backgrounds and are never tinted by the wallpaper. If you want the wallpaper to cover those panels too (not recommended — the blend mode will tint them), raise the
z-indexof.bgc-layerinstyles.css.
Frameless window mode (
is-hidden-frameless, common on Windows and Linux) is handled by Obsidian itself: core gives.titlebarbackground: transparent,border: noneandz-index: var(--layer-popover). It is a transparent drag strip, so the wallpaper shows through it in both modes, and the plugin no longer needs to touch itsz-index(1.0.1 pushed it down to--layer-status-bar, a workaround that is unnecessary now that the wallpaper sits below the interface).
Requires Obsidian 1.13.0 or later (dynamic styling uses the official
setCssPropsAPI).
Some themes paint the workspace, sidebars and title bar with opaque background colors (Royal Velvet, for example, uses a palette of --layer-0 … --layer-4 across the whole UI). In overlay mode those colors take part in the mix-blend-mode computation and pull the wallpaper toward the theme palette: the image looks gray or purple, and its dark areas get lifted. It looks like the theme is applying a filter to your background.
Measured conclusion: this is usually not an actual filter or mask layer in the theme (there is no
filter,backdrop-filteror full-screen overlay to be found in Royal Velvet). It is simply the normal result of a blend mode meeting the content behind it.
Turn on Settings → Background Cover → Theme integration → Make theme background transparent. It does two things at once, and they only work together:
z-index: -1, blend mode normal). This is the part that removes the other half of the problem: in overlay mode the wallpaper is composited with the interface content as well, so on dark themes the bright elements (text, form fields, code blocks) are lifted into the image through lighten — the image and the interface each look half transparent, and on light themes the light panels are multiplied into the image until it looks like something is covering it. As a real background layer, the wallpaper is composited only with the neutral base color, and the interface is painted on top of it..workspace (custom properties inherit downward), while Obsidian's modals live under body, siblings of .app-container and outside .workspace, so they are not affected. Do not move these variables back to body or .theme-*: once --background-primary becomes transparent globally, the settings window, command palette and menus all go transparent with it..view-header, the strip showing the current file name) is handled too. Core sets its background through --file-header-background / --file-header-background-focused, which are also resolved at the root and derive from --background-primary; what is more, its "active leaf + focused window" rule uses four classes ((0,4,0)) and beats an ordinary element-level override, so the plugin blanks the variable instead. A useful diagnostic trick: if an area only looks different while focus is in the note body and returns to normal the moment you click a sidebar or open a separate settings window, you are looking at a focus/active-state rule with higher specificity.--background-modifier-border (which --divider-color defaults to) to transparent, leaving the UI with no dividers at all. With this option on, the plugin draws a 1 px line between the top (tab bar / title bar) and the workspace, and colors the sidebars' .workspace-leaf-resize-handle so the sidebars get their divider back as well. Both lines have their own switches, and the color and opacity are configurable. Only that handle is colored; no other divider in the workspace is touched.--layer-1 / --layer-2 and fills math blocks and quotes with --layer-1. As long as the wallpaper was an overlay those colors sat underneath it and were invisible; with the wallpaper below the interface they turned into opaque blocks lying on top of it (on a light theme, all but white). This option clears their background color so the wallpaper shows through the text area, removes a table's frame (themes often draw it as an outline in a theme color), and turns the hovered table row into a light veil instead of an opaque stripe (a slight darkening on light themes). Everything that is deliberate decoration is kept — table header gradients, formula blocks' and quotes' colored borders — and nothing outside that list is touched (panels, buttons, callouts, tags, sidebar highlights).0.4 the image contributes 40% and the workspace base color the other 60%, so it looks dim on a dark theme and pale on a light one — that is what a translucent layer over a light background means, and it is not something the plugin can remove. What changed in 1.1.0 is that the interface no longer mixes into the image on top of that: at low opacity the image now looks uniformly faded instead of smeared wherever text and panels sit over it. Light themes are fully supported; if you want the wallpaper to keep more of its color, raise the opacity..workspace and need separate treatment, otherwise the wallpaper is cut off across them. If you do not want them transparent, delete the corresponding rules in styles.css..bgc-layer (carrying mix-blend-mode and blur, whose properties stay completely constant) plus two image children .bgc-layer-image that crossfade by alternating opacity. The container is mounted on document.body, after .app-container. Its z-index and blend mode are decided purely in CSS by whether body has the bgc-transparent-theme class (overlay z-index: 20 / real background z-index: -1), so switching the theme-transparency setting never touches the layer from JavaScript.getCurrentPath()), not from the persisted setting, so during auto rotation it always copies what is on screen at that moment. It copies the file name only: the name is enough to find the image in your folder, while a full path leaks your local directory layout into anything you paste it into.imageSize.ts reads at most 64 KB (1 MB for JPEG, which may keep its SOF marker far into the file) and interprets the PNG IHDR, JPEG SOF, GIF, BMP, WebP VP8/VP8L/VP8X, AVIF ispe or SVG width/height fields. Decoding thousands of wallpapers through an <img> or a canvas would cost seconds and hundreds of megabytes; parsing headers is a few milliseconds per hundred files.image-index.json lives in the plugin's own folder, so a rescan after adding five images reads five headers, not five thousand. The cache is keyed on absolute paths — moving the wallpaper folder therefore just means one new scan, not a corrupted index.resolveSizeModel() computes background-position for the size mode and, when the image is portrait and the mode is cover, swaps the vertical half of the position for center <n>%. cover is the only mode that crops, so it is the only mode where moving the image does anything; the landscape path keeps the original center value verbatim.mix-blend-mode or filter is promoted to its own compositing layer while an opacity animation runs, and the blend mode degrades to normal — the whole screen flashes brighter and covers the UI at the moment of the switch. vscode-background-cover's A6 fix records this trap; this plugin split "blend mode + blur" and "crossfade" onto different elements accordingly.opacity: 0, and its background-image is kept until it is overwritten. An earlier version cleared the "old layer" with a 400 ms timer, which — when you clicked quickly — also wiped the image that had just become active, making the background disappear entirely. Fixed, and the plugin now uses no timers for this at all.blob: URL (about 50 characters) written into the image layer's --bgc-image variable. Do not switch this to data:...;base64,...: that requires putting the whole image into an inline CSS declaration, and browsers impose a length limit on a single CSS declaration value. An over-long value is silently discarded — no error anywhere — after which background-image: var(--bgc-image, none) resolves to none and the background vanishes. Measured in Chromium: a 2 MB value survives intact, a 4 MB value makes getPropertyValue() return an empty string. A high-resolution wallpaper's base64 is routinely several to tens of MB, so the data URL approach manifests as "most images do nothing when clicked, and occasionally a small one works". A blob URL has no length limit and skips base64's 33% overhead.--bgc-* only ever receives legal tokens (none, cover, blur(4px), …) and never nests var(). A var() fallback only applies while the variable is undefined; once a variable is defined to an invalid token, the whole declaration — mix-blend-mode included — is dropped. That is the usual root cause of "the background is there but the blend mode stopped working". Blend mode and transitions are therefore expressed purely as CSS classes, not variables.auto blend mode is pure CSS. body.theme-light / body.theme-dark select multiply / lighten, so switching themes applies instantly with no JS theme listener.getCurrentPath()) and the settings page reads that real state rather than keeping a second copy. Each switch also carries a request sequence number, so only the last read that was started is applied and out-of-order async reads cannot desynchronise the display.Very large images: if your folder contains a few extremely high-resolution images (a panorama can easily exceed 8000×5000), decoding will be noticeably slower and memory will spike briefly when one comes up. That is the cost of the image itself — the plugin still holds only that one. Change background now skips past it.
npm install # install dependencies
npm run dev # watch mode, compiles into output/
npm run build # production build (tsc type check + esbuild bundle) into output/
npm run lint # ESLint
Build artifacts go to output/, which contains main.js, manifest.json and styles.css — a folder that can be dropped straight into a vault or attached to a GitHub release.
Source layout:
src/
main.ts # plugin lifecycle, commands, status bar, folder scan cache, scan coordination
background.ts # background layer: dual image layers, blob URLs, blend classes
settings.ts # settings interface, defaults and the settings tab
i18n.ts # UI strings (English + Chinese) and language selection
css.ts # size-mode → CSS mapping, colour helpers
folder.ts # path expansion, recursive scan, shuffle playlist
imageSize.ts # image dimensions from the file header (no decoding)
imageIndex.ts # size cache on disk, aspect ratio helpers
See CONTRIBUTING.md for the constraints that apply to changes, the UI text rules and the release process.
There is no automated test suite in this repository. Changes are verified locally by loading the built main.js in a headless browser against a harness that recreates Obsidian's DOM; that harness depends on a local wallpaper folder, so it is not shipped here. If you change rendering behaviour — blend modes, z-index, the theme-transparency feature — please say in your pull request how you verified it and on which theme.
npm version <x.y.z>. The version script updates manifest.json and versions.json; .npmrc sets tag-version-prefix="" so the git tag is the bare version with no v prefix..github/workflows/release.yml builds the plugin, attests build provenance, and publishes a release with main.js, manifest.json and styles.css attached. The workflow refuses to publish if the tag does not match the version in manifest.json.version in your manifest, so the tag must match exactly and the release must be published, not a draft.The submission process is self-service at community.obsidian.md — there is no longer a pull request to obsidian-releases.
manifest.json's version, with main.js, manifest.json and (optionally) styles.css attached.manifest.json from the HEAD of the default branch, so make sure it is committed. The id must be unique across all published plugins and must not contain obsidian.See Submit your plugin and the submission requirements for the authoritative details.
The design and implementation of this plugin were informed by the following open-source projects:
src/loaderFragments.ts about mix-blend-mode / filter degrading when an element is promoted during an opacity animation is what this plugin's layer structure is built around.The two background projects are MIT-licensed, so the design ideas and parameter semantics borrowed from them are used within their terms. This project is an independent implementation and contains no copied source text from either of them; the attribution above is given because it is the right thing to do, not because a licence compels it.
The scaffold is a different matter: it is derived from obsidian-sample-plugin, so the copyright and permission notice required by its ISC license is retained in THIRD-PARTY-NOTICES.md.
The code and documentation of this project were produced with AI assistance:
deepseek-flash, via the DeepSeek Harness coding agent) — fixed the "background disappears after rapid switching" and "settings page shows a different name than the actual background" defects; found and fixed the deeper root cause (writing images into inline CSS as data URLs exceeds the browser's per-declaration length limit and is silently discarded — measured between 2 and 4 MB — now using blob URLs); restructured the background layers to separate blend mode/blur from the crossfade; completed the blend-mode and opacity failure handling; rewrote the styles, build output and this documentation; verified each change by loading the real build artifact in a headless browser against a local Obsidian DOM harness; and localised the UI, added the contributor and issue-template files, and prepared the project for the community directory.All AI-generated content was reviewed by a human and passes TypeScript type checking, ESLint and a render verification of the built artifact. If you have concerns about AI-assisted development, the source and commit history are open to inspection.
Released under the MIT License.
Disclaimer: This project is an independent community plugin and is not affiliated with or endorsed by Obsidian.