Image Zoom
approvedby liominsb
Lightweight image zoom and drag viewing plugin, supports wheel zoom and mouse drag panning. - This plugin has not been manually reviewed by Obsidian staff.
Image Zoom
A lightweight Obsidian plugin for image zoom and pan. Designed as a drop-in replacement for the unmaintained Image Toolkit.
π Features
- Click to Zoom β Click any image in Reading or Live Preview mode to view it full-screen.
- Scroll to Zoom β Use the mouse wheel for smooth, stepless zooming centered on the pointer.
- Drag to Pan β When zoomed in, hold the left mouse button and drag to move the image.
- Quick Exit β Press
Escor click the dark backdrop to close instantly. - Lightweight β Vanilla TypeScript, zero dependencies, just a few hundred lines of code.
- Performance β Throttled with
requestAnimationFramefor buttery-smooth interactions. - Style Isolation β All CSS classes use a unique prefix to avoid conflicts with Obsidianβs native styles.
β‘ Installation
Method 1: Manual Installation (Recommended)
-
Download the plugin files
Prepare the following three files:
manifest.jsonmain.js(needs to be built)styles.css
-
Locate the Obsidian plugins folder
- Open Obsidian Settings β Community plugins and turn off Safe Mode.
- Click the folder icon to open the plugins directory.
- The typical path is:
<your vault>/.obsidian/plugins/
-
Create the plugin folder
Inside the
pluginsdirectory, create a new folder namedimage-zoom. -
Copy the files
Copy
manifest.json,main.js, andstyles.cssinto theimage-zoomfolder. -
Enable the plugin
- Restart Obsidian.
- Go to Settings β Community plugins.
- Find Image Zoom and enable it.
Method 2: Development Mode Installation
-
Clone or download this repository
git clone <repository-url> cd image-zoom-pan -
Install dependencies
npm install -
Build the plugin
npm run build -
Copy to your Obsidian vault
Copy the built files to your vaultβs plugins folder:
<your vault>/.obsidian/plugins/image-zoom-pan/ -
Enable the plugin
Enable the plugin in Obsidianβs settings.
π Development
Prerequisites
- Node.js >= 16
- npm or yarn
Commands
# Install dependencies
npm install
# Development mode (auto-rebuild)
npm run dev
# Production build
npm run build
Project Structure
image-zoom/
βββ manifest.json # Plugin metadata
βββ main.ts # Core logic
βββ styles.css # Stylesheet
βββ package.json # Dependencies & scripts
βββ tsconfig.json # TypeScript configuration
βββ esbuild.config.mjs # Build configuration
βββ README.md # This file
π‘ Usage
- In Reading or Live Preview mode, click any image.
- The image appears centered on a semi-transparent black backdrop.
- Scroll to zoom β Use the mouse wheel to zoom in/out, centered on the cursor.
- Drag to pan β While zoomed in, drag with the left mouse button.
- Exit the viewer:
- Press the
Esckey. - Click the dark background outside the image.
- Press the
π οΈ Under the Hood
- Vanilla Implementation β Uses only TypeScript and DOM APIs. No UI frameworks.
- Optimized Rendering β Drag and zoom events are throttled with
requestAnimationFrame. - Scoped Styles β All CSS classes are prefixed with
my-custom-zoom-to prevent leaks. - Broad Compatibility β Works with Obsidian v1.5.0 and above.
β Troubleshooting
If something isnβt working, please verify:
- Obsidian is version 1.5.0 or later.
- The plugin is correctly installed and enabled.
- You are in Reading mode or Live Preview mode (not Source mode).
π License
MIT License
π Acknowledgements
Inspired by Image Toolkit. This plugin offers a modern, maintainable alternative with a focus on simplicity and performance.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.