
What is Local Img?
Local Img is a powerful Obsidian plugin designed to solve the problem of external image dependencies in your notes. It allows you to download and manage images from the web directly into your Obsidian vault, converting online image links to local files. This makes your notes truly portable and protects them from link rot - when external images disappear or change location.
Why I Created This Plugin
As an Obsidian user, I often find myself copying content from websites, blogs, and various online resources into my notes. However, I quickly ran into an issue: the images in my notes were still linked to external sources, creating several problems:
- Dependency on internet access - I couldn't view images when offline
- Link rot - External images would sometimes disappear or change
- Privacy concerns - My note viewing would generate external requests
- Portability issues - Moving my notes to different systems meant broken images
I wanted a seamless way to convert these external images to local ones while preserving my notes' formatting. Existing solutions were either too manual or didn't properly handle images that required specific HTTP headers for access. Local Img was created to address these issues with a user-friendly interface and powerful features.
Key Features
One-Click Downloads
Convert all external images in your notes to local files with a single click
Referer Support
Download images that require specific referrer headers to bypass anti-hotlinking protection
Image Management Panel
Dedicated panel to view, manage, and download external images in your current note
Custom Storage Location
Choose where to save your downloaded images - default folder or custom directory
Auto-deletion
Optionally remove associated images when notes are deleted to keep your vault clean
Status Tracking
Clear visual indicators for download status (success, pending, failed) for each image
How It Works
Local Img scans your notes for external image links (URLs that appear in Markdown image syntax). When you choose to download these images, the plugin:
- Download each image to your specified location
- Update the Markdown links in your notes to point to the local files
- Maintains a mapping between remote URLs and local files for management
For images that require specific HTTP headers (like Referer), the plugin provides options to specify these values or detect them automatically from your note content.
How to Use Local Img
Installation
- Open Obsidian Settings
- Go to Community Plugins and disable Safe Mode if necessary
- Click "Browse" and search for "Local Img"
- Install the plugin and enable it
Quick Start Guide
- Open a note containing external images
- Click the image file icon in the ribbon (left sidebar)
- The plugin will detect all external images and display them in the right panel
- Click "Download All Images" to download them locally
Available Commands
The plugin adds several commands you can access via the Command Palette (Ctrl/Cmd+P):
Show Image Downloader View
Opens the image panel without downloading anything
Download images with referer
Prompt for a referrer URL before downloading images
Quick download images
Attempts to download images without prompting for a referer
Working with Websites that Require Referers
Some websites prevent direct image downloading unless the request includes a "Referer" header. Local Img handles this in several ways:
- Automatic detection - The plugin tries to extract the referrer from:
- URLs in your note's frontmatter
- The first URL found in your note
- Manual input - If no referrer is found, the plugin will prompt you to enter one
- Quick download - If a referrer is already known, "Quick download images" will use it without prompting
Using Frontmatter for Referers
You can add a URL to your note's frontmatter, and the plugin will use it as the referrer:
--- source: https://example.com/some-page ---
This is especially useful for notes where you frequently add content from the same source.
Plugin Settings
To configure the plugin, go to Obsidian Settings and navigate to the "Local Img" section:
Image Save Directory
- Leave empty to use Obsidian's default attachment folder
- Enter a custom path (e.g., "images" or "./images") to use a specific folder
- Relative paths are based on the note's location
Auto-delete Images
- When enabled, downloaded images will be automatically deleted when the associated note is deleted
- Only delete images that aren't referenced by other notes
Tips and Troubleshooting
Image Download Failures
If the images fail to download:
- Check the referrer - Make sure you're using the correct referrer URL
- Website restrictions - Some websites actively prevent image hotlinking
- Try again later - Temporary network issues might resolve themselves
Handling Large Notes
For notes with many images:
- Download them in smaller batches if needed
- Use the individual download buttons for specific images
Performance Considerations
- The plugin maintains a mapping of files and their associated images
- This mapping is updated whenever you open a note with external images
- When deleting notes with multiple images, there might be a brief delay
Advanced Usage
Using with Templates
If you frequently download images from the same websites, consider adding the source URL to your templates:
--- source: https://example.com ---
Integration with Other Plugins
Local Img works well with other automation plugins. You can create macros or hotkeys for:
- Open the Image Downloader panel
- Download all images
- Deleting local images