Compress Images in Obsidian Without Quality Loss
In this article
Yes, you can compress images in Obsidian without visible quality loss by using external tools to optimize image files before inserting them, since Obsidian itself does not include built-in image compression. This process reduces file size for faster vault loading and syncing while preserving clarity, especially important for diagrams, screenshots, and handwritten notes.
What You'll Need
- Obsidian installed (any supported version)
- Access to an image optimization tool (desktop or online)
- Original image files (PNG, JPG, or WebP) you plan to insert
- Basic understanding of file management in your operating system
Step-by-Step
- Locate the image file you want to insert into your Obsidian note. Do not drag and drop it directly into Obsidian yet.
- Use an image optimization tool to compress the file. Recommended free tools include:
- Squoosh.app (web-based, open-source by Google)
- ImageOptim (macOS desktop app)
- Caesium (Windows desktop app)
- OptiPNG or jpegoptim (command-line tools for advanced users)
- Upload or open the image in your chosen tool. In Squoosh, for example, drag the image into the browser window.
- Adjust settings to maintain visual quality. For JPG, use a quality setting of 80–90. For PNG, enable lossless compression and reduce color palette if possible (e.g., from 24-bit to 8-bit if the image supports it).
- Preview the compressed version. Zoom in closely to check for artifacts, blurriness, or color shifts, especially around text or sharp edges.
- Download or save the optimized image with a clear filename (e.g.,
screenshot_diagram_optimized.jpg). - Move the compressed image into your Obsidian vault’s attachments folder (e.g.,
MyVault/attachments/). You can create a subfolder likeoptimized-imagesfor organization. - In your Obsidian note, insert the image using Markdown syntax:
![[screenshot_diagram_optimized.jpg]]. - Review the note in both edit and preview mode to confirm the image displays correctly and remains sharp.
- Optionally, rename the original image with a suffix like
_backupor move it to a separate folder so you can recover it if needed.
Common Mistakes
- Compressing after inserting: If you drag an image directly into Obsidian first, the original file is embedded, and replacing the file later may break the link or require manual path updates.
- Over-compressing JPG files: Setting quality below 75 can introduce visible artifacts, especially in diagrams or text-heavy images.
- Using lossy compression for line art: PNG is better suited for screenshots with text. Converting PNG to JPG—even at high quality—can blur sharp edges.
- Ignoring file naming: Using generic names like
image1.jpgmakes it hard to track optimized vs. original versions. - Skipping preview: Always compare the original and compressed versions side by side at 100% zoom to catch subtle quality loss.
Tips
- Create a batch processing workflow: Optimize multiple images at once using tools like ImageOptim or Caesium that support folder-wide compression.
- Use WebP format for photos: WebP offers smaller file sizes than JPG at similar quality, but ensure your vault is not shared with users who may not support WebP in older apps.
- Set up a dedicated folder outside your vault for originals, so you always have access to uncompressed versions.
- In Obsidian, use the
attachmentsfolder defined in Settings > Files & Links > Attachment folder location to keep media organized. - Enable “Always save images to attachments folder” in Obsidian settings to avoid accidental clutter in your vault root.
Troubleshooting
If the image does not appear in your note:
- Check the file path: Ensure the image is in the correct folder and the filename in the Markdown link matches exactly, including case and extension.
- Refresh the note: Sometimes Obsidian caches images. Reload the app or switch notes and return.
- Verify file format support: While Obsidian supports JPG, PNG, and WebP, some older versions may not render WebP correctly on all platforms.
If quality loss is visible:
- Re-process the image with higher quality settings. For JPG, increase to 90 or 95. For PNG, disable dithering or palette reduction if used.
- Consider keeping the original if optimization degrades readability, especially for diagrams or scanned notes.
If the file size did not reduce significantly:
- The image may already be optimized. Avoid re-compressing optimized files, as it yields minimal gains and risks quality loss.
- For PNG files, try reducing bit depth or using tools like OptiPNG with aggressive settings.
Frequently Asked Questions
Does Obsidian compress images automatically?
No, Obsidian does not compress or modify images when you insert them. The original file is stored and displayed as-is.
Can I use TinyPNG or similar online tools?
Yes, but only if you trust the service with your data. TinyPNG is reputable and uses lossless compression for PNG and lossy for JPG. Avoid uploading sensitive or private notes.
Will compressing images affect backlinks or embeds?
No, as long as the filename and path remain unchanged. If you replace the file in the same location, all links continue to work.
Is WebP better than JPG for Obsidian?
WebP typically offers 25–35% smaller file sizes than JPG at equivalent quality, but verify compatibility if sharing vaults. Some mobile clients may not render WebP as reliably.
Can I automate image compression?
Yes, using tools like Hazel (macOS) or batch scripts with Squoosh CLI or ImageMagick. Set up a folder watcher that compresses images upon arrival.
Should I compress every image in my vault?
Focus on large files (over 500 KB) or frequently accessed notes. Small images (under 100 KB) offer little benefit and may not need optimization.