Image to HTML

by 0x1DA9430
5
4
3
2
1
Score: 52/100

Description

Category: Note Enhancements

The Image to HTML plugin enhances how pasted images are handled in Obsidian by converting them into HTML image tags instead of the default markdown or wikilink formats. This approach improves compatibility when sharing notes across platforms or with editors that don't support Obsidian's native syntax. Users can customize the image width and define where images are saved, either relative to the note or within a fixed directory.

Reviews

No reviews yet.

Stats

6
stars
786
downloads
3
forks
410
days
413
days
413
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

a year ago

Changelog

Release 1.0.2

README file from

Github

Image to HTML

中文文档

A plugin for Obsidian that converts pasted images to HTML format instead of Obsidian's wikilink or Markdown format.

Features

  • Saves pasted images as files and inserts them as HTML image tags
  • Supports custom image width
  • Supports custom image save paths (e.g., ./assets)
  • Optional alt attribute for better accessibility
  • Optional paste notifications

Why HTML Format?

HTML image tags offer better compatibility across different platforms compared to Markdown or Obsidian's wikilink format. This is particularly useful for users who need to share their notes across different platforms and Markdown editors.

Usage

  1. Install the plugin in Obsidian
  2. Copy an image (from browser, file explorer, or screenshot tool)
  3. Paste in the Obsidian editor
  4. The image will be saved and inserted as HTML: <img src="https://raw.githubusercontent.com/0x1DA9430/img2html/HEAD/image_name.jpg" width="auto">

Custom Image Path

You can enable the "Use Custom Image Path" option in settings and set a custom save path for your images:

  • Relative paths (e.g., ./assets or ../images): Images will be saved in the specified directory relative to the current file
  • Absolute paths (e.g., assets or images): Images will be saved in the specified directory under your vault root

When custom path is enabled, the src attribute in HTML tags will be updated accordingly, for example:

<img src="https://raw.githubusercontent.com/0x1DA9430/img2html/HEAD/assets/image_1234567890.jpg" width="auto">

If custom path is disabled, images will be saved in the same directory as the current file, and the HTML tag will only use the filename:

<img src="https://raw.githubusercontent.com/0x1DA9430/img2html/HEAD/image_1234567890.jpg" width="auto">

About Alt Attribute

By default, the plugin generates HTML tags without the alt attribute to keep the code concise. If you need better accessibility or SEO optimization, you can enable the "Include Alt Attribute" option in settings, which will generate tags like:

<img src="https://raw.githubusercontent.com/0x1DA9430/img2html/HEAD/image_1234567890.jpg" width="auto" alt="image_1234567890.jpg">

About Custom Attributes

You can enable "Use custom attributes" to disable both the image width and alt tag setting in favor of a fully custom list of attributes, such as a custom CSS class or variables therein. Using this function, you can generate tags like:

<img src="https://raw.githubusercontent.com/0x1DA9430/img2html/HEAD/assets/image_1778330017341.png" class="image-class" style="--img-width: 40vw;">

Settings

  • Image Width: Set the image width, can be pixels (e.g., 500px), percentage (e.g., 100%), or auto
  • Use Custom Image Path: When enabled, images will be saved to the specified path instead of the current file's directory
  • Custom Image Path: Set the image save path, can be relative (e.g., ./assets) or absolute (e.g., assets)
  • Include Alt Attribute: When enabled, HTML image tags will include the alt attribute for better accessibility and SEO
  • Use Custom Attributes: When enabled, uses custom HTML attributes specified below (e.g. a custom class) and ignores the image width and alt tag setting
  • Custom Attributes: String of custom attributes to use for the final HTML output
  • Show Notifications: Choose whether to show notifications when pasting images

Installation

From Obsidian Community Plugins

  1. Open Obsidian Settings
  2. Go to "Community Plugins"
  3. Disable "Safe Mode"
  4. Click "Browse"
  5. Search for "Image to HTML"
  6. Click Install
  7. Enable the plugin

Manual Installation

  1. Download the latest version of main.js, manifest.json, and styles.css
  2. Copy these files to your vault's .obsidian/plugins/img2html/ directory

Development

  1. Clone this repository
  2. Run npm install to install dependencies
  3. Run npm run dev to start compilation in watch mode
  4. Copy main.js and manifest.json to your vault's .obsidian/plugins/img2html/ directory for testing

License

MIT

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Image Window
4 years ago by Jeremy Valentine
Adds the ability to open images in new Obsidian windows
Copy as HTML
4 years ago by Bailey Jennings
A simple plugin that copies the selected text to your clipboard as HTML
Chevereto Image Uploader for Obsidian
4 years ago by kkzzhizhou
obsidian plugins: chevereto image uploader
Paste image rename
4 years ago by Reorx
Renames pasted images and all the other attachments added to the vault
Obsidian Enhancing Export
4 years ago by YISH
This is an enhancing export plugin base on Pandoc for Obsidian (https://obsidian.md/ ). It's allow you to export to formats like Markdown、Markdown (Hugo https://gohugo.io/ )、Html、docx、Latex etc.
Image Gallery
4 years ago by Luca Orio
A zero setup masonry image gallery for Obsidian
Copy document as HTML
3 years ago by mvdkwast
Obsidian plugin: copy document as HTML, including images
Emo
3 years ago by yaleiyale
Use image/file hosting in Obsidian by clipboard or draging file. Obsidian 图床聚合 & Github上传器
Image Layouts
3 years ago by Luke Chadwick
Obsidian markdown export
3 years ago by bingryan
This plugin allows to export directory/single markdown to a folder. support output format(html/markdown/text)
Paste As Html
3 years ago by maotong06
Local images plus
3 years ago by catalysm, aleksey-rezvov, Sergei Korneev
This repo is a reincarnation of obsidian-local-images plugin which main aim was downloading images in md notes to local storage.
Webpage HTML Export
3 years ago by Nathan George
Export html from single files, canvas pages, or whole vaults. Direct access to the exported HTML files allows you to publish your digital garden anywhere. Focuses on flexibility, features, and style parity.
Image Captions
3 years ago by Alan Grainger
Add captions to images with inline Markdown and link support. The caption format is compatible with the CommonMark spec and other Markdown applications.
Custom Classes
3 years ago by Lila Rest
A minimal Obsidian plugin that allows you to add your own HTML classes to chosen Markdown elements directly from your notes.
Awesome Image
3 years ago by AwesomeDog
One-stop solution for image management.
Avatar
3 years ago by froehlichA
An obsidian plugin for displaying an avatar image in front of your notes.
Image OCR
3 years ago by kaffarell
Runs ocr on pasted images and posts result in details box. This allows to search in images.
Image To Lskypro
3 years ago by NekouTarou
支持直接上传图片到图床Lsky,基于https://github.com/renmu123/obsidian-image-auto-upload-plugin.git改造。
Html Server
3 years ago by Pr0dt0s
Obsidian plugin to serve a vault as an html site.
Cloudinary
3 years ago by Uday Samsani, Jordan Handy
Cloudinary plugin for content uploading and transformation.
Image Converter
3 years ago by xRyul
⚡️ Convert, compress, resize, annotate, markup, draw, crop, rotate, flip, align images directly in Obsidian. Drag-resize, rename with variables, batch process. WEBP, JPG, PNG, HEIC, TIF.
Media Sync
3 years ago by fnya
Media Sync is Plugin for Obsidian
Qiniu Image Uploader
3 years ago by Jade Zheng
Uploads images from your clipboard to qiniu.com and embeds uploaded image to your note.
Image2LaTEX
3 years ago by Hugo Persson
This is a plugin for obsidian that will read your latest copied image from clipboard and generate math latex from it
Markdown Image Caption
3 years ago by Hananoshika Yomaru
Generate image caption easily. Completely markdown-based.
Paste Link
2 years ago by Jose Elias Alvarez
Intelligently paste Markdown links in Obsidian.
Image Helper
2 years ago by Chongmyung Park
Context menu to convert a image to another format in reading view in Obsidian.md
Paste From History
2 years ago by Daniel Karakka
Obsidian plugin that adds the ability to paste text from Obsidian's clipboard history.
Image Inline
2 years ago by Zackary W
convert images into base64 encoded strings and embed them directly within your notes
Image Collector
2 years ago by tdaykin
Paste transform
2 years ago by Timofey Koolin
Copy as source
2 years ago by @gapmiss
Select and copy source HTML in reading view in Obsidian.md
Image Magician
2 years ago by luxmargos
This is a plugin for Obsidian (https://obsidian.md). Supports viewing and exporting various image formats using ImageMagick.
Display Relative Path Img
2 years ago by Dyc
Display the relative path image referenced by <img> in Obsidian without altering the original document
Tiff Viewer
2 years ago by Jan Ullmann
An obsidian plugin to easily convert tiff files to png so that they can be displayed in obsidian
Line Commands
2 years ago by charliecm
Adds commands to quickly select, copy, cut, and paste lines under the selection or cursor.
Smart HTML Select
2 years ago by Isaia Riva
An Obsidian plugin to insert a smart HTML select element into the editor
ii
2 years ago by Wilson
The main feature of this plugin is to quickly insert common Markdown code and HTML code, including Sup, Sub, Audio, Video, Iframe, Left-Center-Right Alignment, Variables, Footnotes, Callout, Anchor Points, HTML Comments and so on.
Image Metadata
2 years ago by alexeiskachykhin
Adds image metadata editing capabilities to Obsidian
Lite Gallery
2 years ago by Jordan Poles
Paste as Embed
2 years ago by Matt Laporte
Obsidian plugin to paste contents of clipboard into a new note, and embed it in the active note.
Fast Image Auto Uploader
2 years ago by Longtao Wu
upload images from your clipboard by gopic
Paste URL into selection
6 years ago by Denis Olehov
Paste URLs into selected text "notion style"
Text expand
6 years ago by MrJackphil
A simple text expand plugin for Obsidian.md
Image in Editor
5 years ago by Ozan Tellioglu
This Obsidian plugin to view Images, Transclusions, iFrames and PDF Files within the Editor without a necessity to switch to Preview.
Clear Unused Images
5 years ago by Ozan Tellioglu
Obsidian plugin to clear the images that are not used in note files anymore
Image auto upload
5 years ago by renmu123
auto upload image with picgo
Image Context Menus
5 years ago by NomarCub
Image Context Menus - Obsidian.md image context menus: copy, open in default app, show in system explorer, reveal in navigation context menu. Also Open PDF externally context menu.
Paste Mode
5 years ago by Jacob Levernier
Obsidian Notes plugin for pasting text and blockquotes to the cursor's current level of indentation.
Image Toolkit
5 years ago by sissilab
An Obsidian plugin for viewing an image.
Banners
5 years ago by Danny Hernandez
An Obsidian plugin that adds banners to your notes
Local images
5 years ago by catalysm, aleksey-rezvov
Mousewheel Image zoom
4 years ago by Nico Jeske
An Obsidian plugin that enables you to increase/decrease the size of an image by holding down a configurable key (defaults to left alt), hovering over an image in preview mode and scrolling.
Enhanced Image
2 years ago by situ2001
Enhance the experience of image in Obsidian, seamlessly.
Pixel Banner
2 years ago by Justin Parker
🚩 Enhance your Obsidian notes with customizable banner images, including AI-generated designs and a curated store of downloadable banners. Transform your workspace with visually stunning headers that add context, improve aesthetics, and take your note-taking beyond the ordinary.
Remove HTML Tag
2 years ago by ChenPengyuan
Find Orphaned Images
2 years ago by Josmar Cristello
Find Orphaned Images is an Obsidian plugin designed to help you keep your vault clean and organized by identifying and managing images that are not linked anywhere in your notes.
Local Media Embedder
2 years ago by seyf1elislam
an obsidian plugin allows you to Embed videos and images and audios from your local device in your notes.
复制图文 (Copy Image Text)
2 years ago by msgk
obsidian插件,复制笔记内容(包括文本和图片)到剪贴板
PDF2Image
2 years ago by RasmusAChr
Arweave Uploader
2 years ago by makesimple
Featured Image
a year ago by Johan Sanneblad
Obsidian plugin to automatically set a featured image property in your notes based on the first image, YouTube link, or Auto Card Link image found in your document. This allows you to create rich note galleries using Folder Notes and Dataview.
Image Tools
a year ago by Andrey Serov
Insta TOC
a year ago by Nick C.
Generate, update, and maintain a table of contents for your notes while typing in real time.
Image Uploader For Note
a year ago by Yunfi
Upload images in a note, and if the image is only used in this note, delete it from vault.
Paste Image Into Property
a year ago by Nito
Media Slider
a year ago by Aditya Amatya
An obsidian plugin that helps to make slider for images, audios, videos, pdfs, markdown, etc in obsidian notes.
Image Picker
a year ago by ari.the.elk
Paste Reformatter
a year ago by Keath Milligan
A plugin for Obsidian that reformats pasted HTML and plain text content, giving you precise control over how content is transformed when pasted into your notes.
Auto Close Tags
9 months ago by k0src
Obsidian MD plugin to auto-close HTML tags.
Paste as file link
8 months ago by Matthias Büge
This plugin is used to paste a text from the clipboard as a link to an existing obsidian note
Memories
3 months ago by DIMFLIX
Plugin to display a gallery directly in a note.