Image AI Renamer

pending

by hzr666ABC

Automatically rename pasted images using AI recognition. Supports Baidu OCR, Baidu image classification, Aliyun, and custom API endpoints.

โ˜… 1 starsUpdated 29d agoMITDiscovered via Obsidian Unofficial Plugins
View on GitHub

๐Ÿค– Image AI Renamer

Paste an image โ†’ AI recognizes it โ†’ file is automatically named and saved. No manual renaming needed.

An Obsidian plugin that automatically calls AI APIs when you paste an image, extracts text (OCR) or classifies image content, and uses the result as a semantic filename.


Features

  • Auto OCR โ€” Extracts text from screenshots and uses it as the filename
  • Auto Image Classification โ€” Recognizes photo content (objects, scenes, categories) when no text is detected
  • Smart Fallback โ€” In Auto mode, tries OCR first; falls back to image classification if no text is found
  • Keyword Filtering โ€” Strips stop words and meaningless tokens to generate clean, readable filenames
  • Multiple Providers โ€” Supports Baidu OCR, Baidu Image Classification, Aliyun, and any custom API endpoint
  • Settings UI โ€” Configure your API keys and preferences directly inside Obsidian

Demo

Paste a screenshot of a document:

Before: paste โ†’ Pasted image 20240101.png
After:  paste โ†’ ๅคงๅญฆ็‰ฉ็†_ๅตŒๅ…ฅๅผ็ณป็ปŸ_ไบบๅทฅๆ™บ่ƒฝๅŸบ็ก€_1712345678.png

Paste a photo:

Before: paste โ†’ Pasted image 20240101.png
After:  paste โ†’ ็Œซๅ’ช_ๆฉ™่‰ฒ_ๅฎคๅ†…_1712345678.png

Installation

From Community Plugins (Recommended)

  1. Open Obsidian โ†’ Settings โ†’ Community plugins
  2. Disable Safe Mode if prompted
  3. Click Browse and search for Image AI Renamer
  4. Click Install โ†’ Enable

Manual Installation

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Copy them to your vault at .obsidian/plugins/obsidian-image-ai/
  3. Reload Obsidian and enable the plugin under Community plugins

Setup

Baidu AI (Recommended for Chinese users)

Baidu offers 500 free calls/day for both OCR and image classification.

  1. Go to ai.baidu.com and log in
  2. Navigate to Console โ†’ ๆ–‡ๅญ—่ฏ†ๅˆซ (OCR) โ†’ Create an application
  3. Copy the API Key and Secret Key
  4. In Obsidian: Settings โ†’ Image AI Renamer โ†’ paste your keys
  5. Make sure the following services are enabled in your Baidu console:
    • ้€š็”จๆ–‡ๅญ—่ฏ†ๅˆซ๏ผˆ้ซ˜็ฒพๅบฆ็‰ˆ๏ผ‰โ€” General OCR (High Accuracy)
    • ๅ›พๅƒๅ†…ๅฎน็†่งฃ โ€” Image Content Understanding

Aliyun

  1. Go to market.aliyun.com and search for ๅ›พๅƒ่ฏ†ๅˆซ
  2. Purchase a plan (free trials available)
  3. Copy your AppCode from the purchased services page
  4. Paste it into Settings โ†’ Image AI Renamer โ†’ AppCode

Custom API

Your endpoint must accept a POST request with:

{
  "image": "<base64 data URI>",
  "mime_type": "image/png"
}

And return one of the following formats:

{ "description": "keyword1_keyword2" }
{ "keywords": ["keyword1", "keyword2"] }
{ "words_result": [{ "words": "recognized text" }] }

Recognition Modes (Baidu only)

ModeBehavior
๐Ÿ”„ Auto (Recommended)OCR first; falls back to image classification if no text found
๐Ÿ“ OCR onlyAlways uses text recognition โ€” best for screenshots and documents
๐Ÿ–ผ๏ธ Classify onlyAlways uses image classification โ€” best for photos

Settings

SettingDescription
AI ProviderChoose between Baidu, Aliyun, or Custom
API Key / Secret KeyCredentials for Baidu OCR
AppCodeCredentials for Aliyun
Custom API URLEndpoint URL for your own AI service
Custom API KeyOptional Bearer token for your custom endpoint
Recognition ModeAuto / OCR only / Classify only (Baidu only)
Attachment FolderWhere to save pasted images (default: attachments)

How It Works

  1. You paste an image in any Obsidian note (edit mode)
  2. The plugin intercepts the paste event
  3. Sends the image (base64) to your configured AI API
  4. Parses the response and extracts meaningful keywords
  5. Generates a filename like ๅ…ณ้”ฎ่ฏA_ๅ…ณ้”ฎ่ฏB_timestamp.png
  6. Saves the image to your attachment folder
  7. Inserts a Markdown image link into your note

Troubleshooting

Paste has no effect

  • Confirm the plugin is enabled under Settings โ†’ Community plugins
  • Make sure you are in Edit mode, not Preview mode

โŒ API ่ฟžๆŽฅๅคฑ่ดฅ: status 401

  • Your API Key or Secret Key is incorrect โ€” copy-paste them again, watch for extra spaces

โŒ ๆœๅŠกๆœชๅผ€้€š

  • Log in to the Baidu console and manually activate the required services

โŒ ๅ›พ็‰‡ไธญๆœชๆฃ€ๆต‹ๅˆฐๆ–‡ๅญ—

  • The image has no readable text; switch to Auto or Classify only mode

Free quota exceeded

  • Baidu allows 500 free calls per day; the count resets at midnight (Beijing time)

Privacy

  • Images are sent to the AI provider you configure (Baidu / Aliyun / your own server)
  • No data is collected by this plugin itself
  • Your API keys are stored locally in your vault's .obsidian/plugins/obsidian-image-ai/data.json

License

MIT ยฉ Your Name

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.