Image-to-prompt Chrome extension for reverse image prompt generation, AI image prompt extraction, and visual marketing diagnosis.
PromptLens is a lightweight image-to-prompt Chrome MV3 extension and reverse image prompt generator. It sends a web image or a selected screenshot region to your own OpenAI-compatible Vision API and generates reusable prompts for Midjourney, Stable Diffusion, commercial visual analysis, and visual marketing diagnosis.
Its goal is to stay simple, transparent, and self-hosting-friendly: no login, no payment system, no built-in backend, and no lock-in to a specific model provider.
- Right-click image analysis: right-click a web image and generate reverse image prompts.
- Selection screenshot analysis: select a visible page region for
blob:images, hotlink-protected images, or remote images without host permission. - Bring your own model service: configure AI Base URL, API Key, and Model.
- OpenAI-compatible Vision API: uses the
/chat/completionsstyle vision request format. - Structured results: Chinese prompt, English Prompt, Tags, Negative Prompt, JSON Prompt, and Raw JSON.
- Professional prompt variants: generates recreate, creative extension, and commercial visual prompt cards for professional design workflows.
- Visual marketing diagnosis: optional business-focused analysis for commercial visuals, with owner-friendly summary, marketing diagnosis, low-cost adaptation brief, and Markdown case export.
- Built-in output templates: Detailed Analysis, Natural Language, Weighted Tags, and Quick Copy.
- Custom templates: copy built-ins, create, edit, delete, import, and export custom templates.
- ChatGPT Plus Assist mode: for users with ChatGPT Plus / Pro but no API key; PromptLens prepares the image and instruction, then can open ChatGPT, wait for the page to settle, and attempt to attach the image and fill the instruction for you to review and send manually.
- Provider presets: OpenAI, DeepSeek, Alibaba, SiliconFlow, Groq, OpenRouter, Ollama, and Custom.
- Keyboard selection shortcut:
Alt+Shift+Sstarts screenshot selection; users can change it atchrome://extensions/shortcuts. - Optional local history: off by default; stores text results, source domain, original image URL, page URL, and template metadata. No image thumbnails are saved.
- Result export: copy individual fields, copy all, download JSON, and download Markdown.
- Local-first: configuration stays in the browser; there is no remote account system.
- Frontend-only: no npm dependencies, no build step, and no backend service.
PromptLens intentionally does not include:
- Login / OAuth
- Payment / quota system
- Built-in cloud service / Supabase
- Cloud history sync
- Auto-fill into third-party generation websites
- Team collaboration or account sync
- Advertising account automation, bidding advice, or guaranteed conversion predictions
- The user right-clicks a web image or starts screenshot selection.
- The extension reads an image URL, data URL, or current-tab visible screenshot.
- The image is validated, cropped, compressed, and normalized to JPEG locally.
- The result page calls the user-configured OpenAI-compatible Vision API with the selected template.
- The model returns JSON; the result page renders it and provides copy / JSON / Markdown export.
PromptLens has two analysis paths: API Automatic Analysis calls your configured OpenAI-compatible Vision API and renders structured results; ChatGPT Plus Assist mode does not call an API and instead prepares a local JPEG plus a ChatGPT-ready instruction for use on chatgpt.com. The experimental ChatGPT handoff can open ChatGPT, wait for the ChatGPT page to settle, then attempt to attach the image and fill the instruction without automatically sending the message.
PromptLens does not provide a built-in model service. You need your own API service that supports vision input.
- Download or clone this repository.
- Open Chrome.
- Go to
chrome://extensions. - Enable Developer mode.
- Click Load unpacked.
- Select the repository root directory.
Not published yet. A Chrome Web Store link will be added here when available.
- Open the extension options page from Chrome extension details.
- Fill in:
- AI Base URL: for example
https://api.openai.com/v1. - API Key: your model service key.
- Model: a model name that supports vision input.
- Default output template: Detailed Analysis, Natural Language, Weighted Tags, or Quick Copy.
- AI Base URL: for example
- Click Save settings.
- To right-click analyze remote images from any website, click Grant image read permission.
Notes:
- AI Base URL must use HTTPS.
- Local development may use
http://localhostorhttp://127.0.0.1. - If you do not grant all-sites image read permission, you can still use screenshot selection.
- Right-click a web image.
- Choose Analyze this image.
- A new result tab opens and shows progress.
- Copy the prompt you need after analysis completes.
If the page reports missing image read permission, grant permission in options or use screenshot selection.
- Right-click anywhere on a page.
- Choose Select screenshot and analyze.
- Drag to select the visible region.
- Wait for the result page to generate prompts.
Press Esc or click Cancel to exit selection mode.
PromptLens v0.6 focuses on helping users complete either an API-based analysis or a no-API-key ChatGPT Plus Assist flow:
- Open the options page.
- Configure your own OpenAI-compatible Vision API: Provider/Base URL, API Key, and a model that supports image input.
- Save settings.
- Analyze a page image with the context menu, or use area capture when site permissions or remote image loading get in the way.
- Copy a prompt/tags/variants result, or export a Markdown brief from the visual marketing diagnosis template.
PromptLens does not provide a model service, backend, proxy, telemetry, account system, or cloud sharing. Analysis requests are sent from your browser to the Base URL you configure.
| Context menu | Options |
|---|---|
![]() |
![]() |
| Result | ChatGPT Plus Assist |
|---|---|
![]() |
![]() |
PromptLens has a simple privacy boundary:
- API Key is stored locally in
chrome.storage.local. - Images are sent only to the AI Base URL you configure.
- The extension has no backend service and collects no telemetry.
- Local history is off by default; when enabled, it stays in the browser, saves source image/page URLs for history recall, and does not save image thumbnails. It may save generated prompt text, including professional prompt variants that describe visible people, brands, products, scenes, or commercial visual details inferred from the image.
- Remote image read permission is optional and is not requested at install time.
- Screenshot selection uses
activeTaband only accesses the current tab after user action.
Experimental ChatGPT handoff: when you click Try sending to ChatGPT, PromptLens may request optional access to https://chatgpt.com/*. This is used only to open ChatGPT, wait for the page to settle, and attempt to attach the prepared local JPEG and fill the instruction into the ChatGPT page. PromptLens does not automatically send the message, does not read ChatGPT replies, and keeps manual download/copy fallback available if the page cannot accept the image or instruction.
When using a third-party model service, images and prompts are sent to that service. Review the provider's privacy policy, retention policy, and terms yourself.
Professional prompt variants are model-generated text suggestions, not official parameters or guaranteed best practices for any third-party generation platform. When you paste prompts into another tool, that tool's privacy, billing, copyright, and content policies apply.
See SECURITY.md for more details.
Permissions used in manifest.json:
contextMenus: create right-click menus.storage: store model config, current template, local history settings, and temporary input.activeTab: access the current tab when the user starts screenshot selection.scripting: inject screenshot selection script and style.commands: register the screenshot selection shortcut.optional_host_permissions: ["<all_urls>"]: request remote image read permission and API origin access only when needed.
- Supported: PNG, JPEG, WebP.
- Not supported: SVG.
- Not directly readable:
blob:images. Use screenshot selection instead. - Remote image file size limit: 20MB.
- Images are normalized to JPEG before sending to the model.
This project intentionally stays simple:
manifest.json Chrome MV3 manifest
background.js Context menus, screenshot capture, temporary payload handoff
content.js In-page screenshot selection interaction
selection.css Screenshot selection styles injected into web pages
options.html/js Options page
history-store.js Local history IndexedDB helper
history.html/js Local history page
templates.js Built-in / custom templates and fixed JSON output schema
result.html/js Result page, export, history save, and model calls
styles.css Options and result page styles
Local checks:
node --check background.js
node --check content.js
node --check templates.js
node --check history-store.js
node --check history.js
node --check options.js
node --check result.jsDevelopment principles:
- No build tools.
- No npm dependencies.
- No remote resources.
- Keep Vanilla JavaScript / CSS.
- Keep new features local-first and privacy-transparent.
The current branch has implemented v0.6.0: First Success onboarding, clearer provider setup guidance, contextual result next steps, marketing context examples, visual marketing diagnosis, Warm Studio UI refresh, summarized history cards, built-in / custom templates, provider presets, keyboard shortcut, result export, token usage, optional local history, basic i18n, Chrome Web Store preparation, ChatGPT Plus Assist mode for no-API-key workflows, and experimental ChatGPT handoff that can open ChatGPT, wait for the page to settle, and attempt to attach the prepared image and fill the instruction after optional user permission.
Future feedback-driven directions:
- More complete English / Traditional Chinese UI translation.
- Firefox MV3 compatibility research.
- Continue tuning image preprocessing defaults based on real feedback.
Issues and pull requests are welcome. Please read CONTRIBUTING.md first.
MIT License. See LICENSE.



