Image AI Renamer
pendingby hzr666ABC
Automatically rename pasted images using AI recognition. Supports Baidu OCR, Baidu image classification, Aliyun, and custom API endpoints.
๐ค 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)
- Open Obsidian โ Settings โ Community plugins
- Disable Safe Mode if prompted
- Click Browse and search for
Image AI Renamer - Click Install โ Enable
Manual Installation
- Download
main.js,manifest.json, andstyles.cssfrom the latest release - Copy them to your vault at
.obsidian/plugins/obsidian-image-ai/ - 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.
- Go to ai.baidu.com and log in
- Navigate to Console โ ๆๅญ่ฏๅซ (OCR) โ Create an application
- Copy the API Key and Secret Key
- In Obsidian: Settings โ Image AI Renamer โ paste your keys
- Make sure the following services are enabled in your Baidu console:
- ้็จๆๅญ่ฏๅซ๏ผ้ซ็ฒพๅบฆ็๏ผโ General OCR (High Accuracy)
- ๅพๅๅ ๅฎน็่งฃ โ Image Content Understanding
Aliyun
- Go to market.aliyun.com and search for ๅพๅ่ฏๅซ
- Purchase a plan (free trials available)
- Copy your AppCode from the purchased services page
- 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)
| Mode | Behavior |
|---|---|
| ๐ Auto (Recommended) | OCR first; falls back to image classification if no text found |
| ๐ OCR only | Always uses text recognition โ best for screenshots and documents |
| ๐ผ๏ธ Classify only | Always uses image classification โ best for photos |
Settings
| Setting | Description |
|---|---|
| AI Provider | Choose between Baidu, Aliyun, or Custom |
| API Key / Secret Key | Credentials for Baidu OCR |
| AppCode | Credentials for Aliyun |
| Custom API URL | Endpoint URL for your own AI service |
| Custom API Key | Optional Bearer token for your custom endpoint |
| Recognition Mode | Auto / OCR only / Classify only (Baidu only) |
| Attachment Folder | Where to save pasted images (default: attachments) |
How It Works
- You paste an image in any Obsidian note (edit mode)
- The plugin intercepts the paste event
- Sends the image (base64) to your configured AI API
- Parses the response and extracts meaningful keywords
- Generates a filename like
ๅ ณ้ฎ่ฏA_ๅ ณ้ฎ่ฏB_timestamp.png - Saves the image to your attachment folder
- 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.