Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Img PreviewNew to Visual Studio Code? Get it now.
Img Preview

Img Preview

Rahul Chouhan

|
5 installs
| (0) | Free
| Sponsor
Blazing fast, lightweight image preview in editor gutter and hover tooltip. Supports SVG, WebP, PNG, JPEG, GIF, AVIF, ICO, Data URIs & remote URLs.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info
Img Preview Icon

Img Preview

Img Preview — Fast & Lightweight Image Previews for VS Code

Visual Studio Marketplace Version Build Status License

GitHub Sponsors Buy Me a Coffee Support on Ko-fi PayPal


Img Preview is a fast, lightweight VS Code extension that brings image previews directly into your coding workflow. It displays thumbnails in the editor gutter and provides rich hover previews with image dimensions, file size, and format information.

No more switching between editor tabs or opening file explorers just to identify an image asset!

Img Preview Live Demo


✨ Features

  • 🎯 Gutter Thumbnail Previews: See miniature image previews directly beside line numbers for referenced images in your code.
  • 🔍 Rich Hover Cards: Hover over an image path or URL to view:
    • Image preview
    • Pixel dimensions (width × height)
    • Formatted file size (KB / MB)
    • Detected image format and MIME type
    • Quick action to Reveal in File Explorer
    • Quick action to Copy as Data URI

Hover Preview and Gutter Thumbnails

  • 📋 Copy as Data URI (Base64): -Convert an image into an inline Base64 Data URI and copy it to your clipboard. -Available through the Command Palette and editor context menu.
  • 📊 Status Bar Counter:
    • Displays the number of images detected in the active document.
    • Click the counter to toggle gutter previews.
  • ⚡ Lightweight & Performance Optimized:
    • Debounced scanning to reduce unnecessary processing while typing.
    • Decoration pooling to reuse editor resources efficiently.
    • Header-based image inspection to retrieve dimensions without reading entire image files when possible.
  • 🌐 Flexible Path Resolution:
    • Relative paths (./icons/logo.svg, ../assets/banner.webp)
    • Common framework aliases (@/assets/..., ~/images/...)
    • Workspace root and /public or /static asset paths
    • Inline Data URIs (data:image/svg+xml;..., data:image/png;base64,...)
    • Remote HTTP/HTTPS image URLs with local caching

🎨 Supported Image Formats

Format Extensions Format Extensions
SVG .svg WebP .webp
PNG .png, .apng JPEG / JPG .jpeg, .jpg
GIF .gif AVIF .avif
ICO .ico BMP .bmp
TIFF .tiff, .tif Data URIs data:image/*

🛠️ Language & File Support

Img Preview detects image references in supported source files, including:

  • Web & Frontend: HTML, JSX, TSX, Vue, Svelte, Astro, CSS, SCSS, LESS
  • Programming Languages: JavaScript, TypeScript, Python, Rust, Go, PHP, C#, Ruby, Dart, Swift
  • Markup & Data: Markdown, MDX, JSON, YAML, TOML, XML

⚙️ Configuration Settings

Customize Img Preview through VS Code Settings (Ctrl+, or Cmd+,):

Setting Type Default Description
imgPreview.enableGutter boolean true Show thumbnail previews in the editor gutter.
imgPreview.enableHover boolean true Show rich preview cards on hover.
imgPreview.gutterIconSize string "contain" Gutter icon scaling mode (contain, cover, auto).
imgPreview.debounceDelay number 200 Delay in milliseconds before re-scanning after typing.
imgPreview.maxFileSizeMB number 25 Maximum image file size in MB to inspect.
imgPreview.enableRemoteImages boolean true Enable downloading and caching remote http/https images.
imgPreview.supportedExtensions array (All formats) File extensions recognized by the scanner.

⌨️ Commands

Access these commands through the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

  • Img Preview: Toggle Gutter Previews: Toggle gutter thumbnails on or off.
  • Img Preview: Clear Image Cache: Clear locally cached image data.
  • Img Preview: Copy Image as Data URI (Base64): Copy an image as an inline Data URI string. Also available through the editor context menu.

🤝 Contributing & Feedback

Have an idea for a new feature or found a bug? Contributions and feedback are welcome!

  • 🐛 Report a bug
  • 💡 Request a feature
  • 💬 Join Discussions
  • 🤝 Contributing Guidelines
  • 📖 Code of Conduct
  • 🔒 Security Policy

💖 Support & Sponsoring

If Img Preview saves you time and improves your development workflow, consider supporting its continued development.

  • ❤️ Sponsor on GitHub
  • ☕ Buy Me a Coffee
  • 🍵 Support on Ko-fi
  • 💙 Donate via PayPal

Every bit of support is appreciated!


📄 License

Licensed under the BSD 3-Clause License. Built with ❤️ by Rahul Chouhan.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft