An Obsidian plugin that converts and optimizes pasted images with customizable settings.
This plugin was inspired by obsidian-paste-png-to-jpeg, but addresses a key limitation: it only converts images when pasting from clipboard, not when drag-and-dropping or synchronizing files. This prevents unwanted conversions during file sync operations with services like Syncthing, Dropbox, or other synchronization mechanisms.
- Smart Paste Detection: Only converts images when pasted from clipboard, not when dragged or synced
- Format Conversion: Convert pasted images to JPEG or WebP format
- Batch Processing: Paste and convert multiple images at once
- Quality Control: Adjustable compression settings for optimal file size
- Image Resizing: Set maximum dimensions to automatically resize large images
- Custom Folder Path: Set a default folder for saved images with support for subfolders
- File Prefix: Add custom prefixes to image filenames, including path separators for subfolder creation
- Interactive Mode: Optional user dialog for per-paste settings customization
- Editor-Only Mode: Option to restrict conversion to editor context only
- Download the latest release from the releases page
- Extract the files to your Obsidian plugins folder:
VaultFolder/.obsidian/plugins/paste-images/ - Reload Obsidian and enable the plugin in Settings → Community Plugins
- Clone this repository into your Obsidian plugins folder
- Run
npm installto install dependencies - Run
npm run buildto build the plugin - Enable the plugin in Obsidian settings
| Setting | Description | Default |
|---|---|---|
| Image Format | Output format for converted images (JPEG/WebP) | JPEG |
| Compression | Quality setting for compression (0.1-1.0) | 0.95 |
| Maximum Dimension | Max width/height in pixels (0 = no resize) | 0 |
| Image Path | Default folder for saved images | "" (current folder) |
| Image Prefix | Prefix for image filenames | "" |
| Convert in Editor Only | Only convert when pasting in editor | true |
| Ask User | Show dialog for per-paste customization | false |
| Save Ask User | Remember the "Ask User" preference | false |
Simply paste an image from your clipboard - it will be automatically converted based on your settings.
Set Image Path to assets/images and Image Prefix to screenshot- to save files as:
assets/images/screenshot-20231201-123456.jpg
Enable "Ask User" to get a dialog box for each paste operation, allowing you to customize:
- Output format (JPEG/WebP)
- Compression quality
- Maximum dimensions
npm install
npm run buildnpm run dev├── main.ts # Main plugin code
├── manifest.json # Plugin manifest
├── package.json # Node.js dependencies
├── tsconfig.json # TypeScript configuration
├── esbuild.config.mjs # Build configuration
├── styles.css # Plugin styles
└── data.json # User settings (created after first use)
- Minimum Obsidian Version: 0.15.0
- Platform Support: Desktop and mobile
- File Formats: Supports clipboard images in common formats (PNG, JPEG, WebP, etc.)
- Check that "Convert in Editor Only" matches your usage context
- Ensure you're pasting (Ctrl+V/Cmd+V) rather than dragging files
- Verify the plugin is enabled in Community Plugins settings
- Use forward slashes (/) for cross-platform compatibility
- Relative paths are relative to the current note's folder
- The plugin will create folders if they don't exist
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details
Created by klaudyu
- Enhanced error handling and TypeScript improvements
- Added support for different image save settings per paste
- Improved user interface and settings organization