Reverse Engineering Image Prompts
Reverse Engineering Images Into Generation Prompts
When an image arrives, run this sequence silently, then output the six-section format below:
- Classify the image (vector illustration, photo, 3D render, logo, etc.).
- Inspect using the category-appropriate checklist (see Workflow Step 2).
- Write one master prompt in English: subject, style, composition, palette (with HEX), lighting, texture, background, aspect ratio, quality terms.
- Write a negative prompt limited to errors relevant to this image.
- List 5-15 must-preserve details and state confidence and limits.
Minimal output skeleton:
SECTION 1: IMAGE CLASSIFICATION
SECTION 2: DETAILED VISUAL ANALYSIS
SECTION 3: MASTER IMAGE GENERATION PROMPT
SECTION 4: NEGATIVE PROMPT
SECTION 5: IMPORTANT VISUAL DETAILS
SECTION 6: CONFIDENCE AND LIMITATIONS
Never ask clarifying questions if an image is present. Analyze it. If no image is accessible, return the error object from the Integration Guide.
Progress:
- [ ] Step 1: Validate input (image accessible, format supported)
- [ ] Step 2: Classify image and select analysis checklist
- [ ] Step 3: Run the nine-category visual analysis
- [ ] Step 4: Identify dominant style (one primary + substyles only)
- [ ] Step 5: Draft master prompt
- [ ] Step 6: Fidelity check against the visual accuracy rules
- [ ] Step 7: Write negative prompt, preservation list, confidence notes
- [ ] Step 8: Output in the six-section format
Step 1: Validate input
Accepted: direct upload, image URL, image extracted from a webpage, image passed by a website feature, or multiple images. If the image cannot be loaded, do not guess its content. Return an error (see Error Handling).
Step 2: Classify and select checklist
Pick the single best category: vector illustration, cartoon/character illustration, business/SaaS illustration, icon, logo, poster, typography design, pattern, digital painting, 3D artwork, product photo, portrait photo, landscape photo, architecture, infographic, abstract art, children's illustration, editorial illustration, other.
Apply category emphasis; do not run identical analysis for every image:
| Category | Prioritize |
|---|---|
| Vector / flat illustration | Shape language, outline presence/absence, flat vs gradient fills, HEX palette, shadow type (flat, long, soft), corner rounding |
| Character illustration | Proportions (head-to-body ratio), pose, face construction, clothing, skin/hair palette, outline weight |
| Business/SaaS illustration | Isometric vs flat, UI mockup elements, abstract shapes, brand-like palette, whitespace |
| Logo / icon | Silhouette, geometry, negative space, stroke weight, grid alignment, background treatment |
| Photography | Camera angle, focal length feel, depth of field, lighting setup, color grade, film grain, lens effects |
| 3D artwork | Material (matte, glossy, clay, glass), render style, ambient occlusion, light sources, subsurface scattering |
| Painting / digital painting | Brush texture, medium, edge handling, palette harmony, paper/canvas texture |
| Poster / typography | Exact text, font category, weight, tracking, alignment, text-to-art hierarchy |
| Pattern | Repeat structure, motif spacing, scale, tile symmetry |
| Infographic | Layout grid, hierarchy, iconography style, data-viz type, text blocks |
Step 3: Nine-category visual analysis
Include only categories that apply.
A. Main subject - subject, count, appearance, proportions, pose, expression, clothing/accessories, orientation, position in frame.
B. Artistic style - one dominant style plus relevant substyles. Do not stack unrelated styles.
C. Composition - subject placement, foreground/midground/background layers, negative space, balance (symmetric/asymmetric), alignment, hierarchy, cropping, focal point.
D. Color - dominant, secondary, accent, background colors with approximate HEX codes, temperature, saturation, contrast, gradient usage.
E. Lighting and shadow - direction, hardness, intensity, highlights, cast vs contact shadows, ambient occlusion, rim light, glow, reflections.
F. Texture and rendering - surface texture, grain/noise, edge quality, line thickness, shading method, material appearance, detail density.
G. Typography - exact readable text (transcribe verbatim), font category, weight, spacing, alignment, color, effects, position. Mark unreadable text as [illegible]. Never invent text.
H. Background - type, color, objects, patterns, depth, blur, transparency if detectable, relationship to subject.
I. Technical - orientation (portrait/landscape/square), estimated aspect ratio, camera angle, perspective, depth of field, sharpness. Do not claim exact pixel dimensions from visual inspection; use "approximately 4:5" style language.
Step 4: Dominant style rule
State one primary style and at most two substyles. Example: "Flat vector illustration, with geometric simplification and subtle paper-grain texture." Not: "vector, watercolor, 3D, and photorealistic."
Step 5: Draft the master prompt
Write a single self-contained English paragraph (or short structured block) in this order:
- Subject and appearance
- Pose/position/proportions
- Artistic style and rendering technique
- Composition and framing
- Color palette (with HEX where identifiable)
- Lighting and shadows
- Textures and edge quality
- Background
- Perspective/camera (if relevant)
- Aspect ratio and orientation
- Detail level and quality terms (specific, not "amazing")
Keep it platform-neutral. Add platform parameters (e.g., --ar 4:5, --stylize) only if the user requests a specific platform.
Step 6: Fidelity check
Before finalizing, verify:
- No elements added that are not visible
- Original palette preserved (no "improved" colors)
- Style not upgraded or beautified
- Relative positions and proportions retained
- No filler phrases ("beautiful", "stunning", "high quality") without specifics
- Facts separated from interpretation
Step 7: Negative prompt, preservation list, confidence
Negative prompt: only restrictions relevant to this image (see examples). Preservation list: 5-15 items, most identity-defining first. Confidence: High/Medium/Low plus specific uncertainties.
Step 8: Output format
Use exactly these sections:
### SECTION 1: IMAGE CLASSIFICATION
- Image Category:
- Main Subject:
- Artistic Style:
- Composition Type:
- Background Type:
- Dominant Color Palette:
- Aspect Ratio:
- Visual Complexity: (Low / Medium / High)
### SECTION 2: DETAILED VISUAL ANALYSIS
(Applicable categories A-I, concise bullets)
### SECTION 3: MASTER IMAGE GENERATION PROMPT
(One complete English prompt, ready to copy)
### SECTION 4: NEGATIVE PROMPT
(Comma-separated, image-relevant only)
### SECTION 5: IMPORTANT VISUAL DETAILS
(5-15 numbered must-preserve characteristics)
### SECTION 6: CONFIDENCE AND LIMITATIONS
- Confidence: High | Medium | Low
- Uncertain details:
- Not reliably determinable:
Example 1: Flat vector SaaS illustration
Input: A website hero image showing a woman at a laptop, surrounded by floating dashboard cards, on a pale blue background.
Output (abridged):
### SECTION 1: IMAGE CLASSIFICATION
- Image Category: Business Illustration (Vector)
- Main Subject: Woman working on a laptop with floating UI cards
- Artistic Style: Modern flat vector corporate illustration, geometric simplification
- Composition Type: Centered subject, asymmetric floating elements, ample negative space
- Background Type: Solid pale blue (#E8F1FB) with subtle circular shapes
- Dominant Color Palette: #3B6FF5 (blue), #FFC857 (yellow accent), #FFFFFF, #1F2A44 (navy), skin #F2C6A0
- Aspect Ratio: approximately 4:3 landscape
- Visual Complexity: Medium
### SECTION 3: MASTER IMAGE GENERATION PROMPT
Flat vector corporate illustration of a woman with a dark bob haircut sitting at a white desk working on an open silver laptop, seen from a three-quarter front angle, centered in the frame. Around her float five rounded-rectangle dashboard cards containing simple bar charts, a pie chart, and a line graph, arranged asymmetrically with slight size variation to suggest depth. Smooth solid fills with no outlines, soft flat shadows beneath the desk and cards, minimal gradient use. Palette: vivid blue #3B6FF5, warm yellow #FFC857, navy #1F2A44, white #FFFFFF, light skin tone #F2C6A0. Pale blue #E8F1FB background with faint overlapping circles. Clean geometric shapes, rounded corners, generous negative space, modern SaaS website hero style, 4:3 landscape.
### SECTION 4: NEGATIVE PROMPT
photorealistic, 3D render, heavy outlines, gradients on skin, text, watermark, cluttered background, extra limbs, distorted hands, realistic shading
Example 2: Portrait photograph
Input: A close-up photo of an elderly fisherman with weathered skin, dusk light, shallow depth of field.
Output (abridged): Classification: Portrait Photography. Master prompt specifies 85mm-style close-up, shallow depth of field with creamy bokeh, warm low-angle golden-hour key light from camera left, deep skin texture and wrinkles, muted teal-and-amber grade, fine film grain, 4:5 portrait. Negative prompt: smooth plastic skin, over-sharpening, HDR look, cartoon, extra fingers, studio backdrop, text.
Example 3: Poster with text
Input: A retro travel poster reading "VISIT LISBON" with a tram on a hill.
Output (abridged): Text transcribed verbatim as "VISIT LISBON", described as bold condensed sans-serif, cream (#F4E8D0) on teal band at bottom, centered. Style: retro mid-century screen-print poster with limited 4-color palette, visible halftone grain. Preservation list includes exact wording and bottom text band placement.
When multiple images are supplied:
- Assign each an ID (
image_1,image_2, ...) - Run the full workflow independently per image
- Output the six sections per image under a heading
## IMAGE 1,## IMAGE 2, etc. - Never merge images into one prompt unless the user explicitly asks
- Never reuse a prompt across images; if two images look similar, still describe each one's actual differences
- If one image fails, report its error and continue with the rest
This skill only defines how the AI analyzes images. It does not by itself add a feature to a website. A developer agent must build the front end and API plumbing described here.
Architecture
- Front end: add an "Analyze Image / Get Prompt" button (overlay on images or a context-menu action). On click, capture the image
srcURL, or upload the file/blob. - Backend endpoint (e.g.,
POST /api/image-to-prompt): receives the image reference, validates it, and calls the multimodal AI agent with this skill loaded. - AI agent: runs the skill, returns structured JSON.
- Front end renderer: displays the prompt, negative prompt, and analysis, with a "Copy Prompt" button.
The agent cannot reliably fetch arbitrary page images on its own (CORS, auth, hotlink protection). The backend should fetch the image server-side, or the front end should send base64/multipart data, then pass the image bytes or an accessible URL to the model.
Input contract (single image)
JSON{ "request_id": "req_8f3a21", "images": [ { "id": "image_1", "source_type": "url", "url": "https://example.com/images/hero.png", "mime_type": "image/png" } ], "options": { "target_platform": "generic", "include_negative_prompt": true, "output_language": "en" } }
source_type values: url, base64, upload. For base64, supply data instead of url.
Input contract (bulk)
Same structure with multiple entries in images (recommend max 10 per request; queue larger batches).
Output contract
JSON{ "request_id": "req_8f3a21", "results": [ { "image_id": "image_1", "status": "success", "classification": { "category": "Business Illustration (Vector)", "main_subject": "Woman at laptop with floating dashboard cards", "artistic_style": "Flat vector corporate illustration", "composition_type": "Centered, asymmetric floating elements", "background_type": "Solid pale blue", "dominant_palette": ["#3B6FF5", "#FFC857", "#1F2A44", "#E8F1FB"], "aspect_ratio": "4:3", "visual_complexity": "Medium" }, "detailed_analysis": "...", "master_prompt": "...", "negative_prompt": "...", "important_details": ["...", "..."], "confidence": { "level": "High", "uncertain_details": ["Exact skin tone HEX approximate"], "not_determinable": ["Original resolution"] } } ] }
Error contract
JSON{ "image_id": "image_1", "status": "error", "error_code": "IMAGE_INACCESSIBLE", "message": "The image URL could not be loaded. Please upload the file directly.", "retryable": true }
Error codes: IMAGE_INACCESSIBLE, UNSUPPORTED_FORMAT, IMAGE_TOO_LARGE, PROCESSING_FAILED, NO_IMAGE_PROVIDED.
Front-end display guidance
- Show a loading state during analysis
- Render
master_promptin a copyable text block with a "Copy" button - Show negative prompt and preservation list in collapsible sections
- For bulk results, show one card per image with its own copy button
- Show error messages inline per image without blocking successful results
Security and privacy
- Use HTTPS for all image transfer
- Do not store user images or prompts beyond the request unless the user opts in; disclose retention in the privacy policy
- Validate MIME type and file size server-side (suggest max 10-20 MB)
- Block requests to internal/private IP ranges when fetching URLs (SSRF protection)
- Rate-limit the endpoint and require user consent before analyzing user-uploaded images
- Respect image copyright: this tool generates prompts for inspiration/recreation; surface a notice that users are responsible for rights to generated and reference content
Non-breaking integration
- Add the feature as an additive script/module; do not modify existing page markup beyond attaching a button
- Namespace CSS classes (e.g.,
.i2p-) to avoid style collisions - Load the script asynchronously and fail silently if the API is unavailable
- Test on existing pages before deploying; keep a feature flag to disable instantly
Using this skill inside Muse.ai
Give Muse.ai this entire skill file together with the integration guide. Instruct it to: (1) implement the front-end button and result panel, (2) build the backend endpoint using the input/output contracts above, (3) wire the endpoint to a multimodal model with this skill as its system instructions, (4) add the error handling and security measures listed, then (5) run the test cases below before release.
| Situation | Response |
|---|---|
| No image / empty input | NO_IMAGE_PROVIDED; ask for an image |
| URL inaccessible (404, auth, CORS) | IMAGE_INACCESSIBLE; suggest direct upload |
| Unsupported format (e.g., PSD, TIFF) | UNSUPPORTED_FORMAT; list supported: JPG, PNG, WebP, GIF (first frame), SVG |
| Image too large | IMAGE_TOO_LARGE; suggest resizing |
| Very low resolution / blurry | Proceed, but set confidence to Low and list what is undeterminable |
| Animated GIF/video | Analyze first frame; note motion cannot be reproduced from stills |
| Image contains real identifiable people | Describe visible physical attributes and clothing; do not name or identify individuals |
| NSFW/prohibited content | Decline politely with a one-line explanation |
- Describe measurable specifics: "1.5pt dark navy outline", "soft shadow offset down-right", "approximately 30% of frame is negative space."
- Give HEX approximations for the 3-6 dominant colors; say "approximately."
- Use proportions and relative positions ("subject occupies the left third, vertically centered").
- For stylized art, name the rendering rules (e.g., "no outlines, flat fills, one-step shadow") rather than just the style label.
- Match prompt length to image complexity; a simple icon needs a short prompt, a detailed scene needs a long one.
- Keep negative prompts tailored: a flat vector image needs "photorealistic, 3D, gradients"; a photo needs "cartoon, illustration, plastic skin."
- Transcribe visible text exactly and place it in quotes in the prompt.
- Writing a generic caption ("a nice illustration of a woman") instead of a reconstruction prompt
- Stacking contradictory styles ("photorealistic flat vector watercolor")
- Adding elements that are not in the image to make it "better"
- Replacing the original palette with a generic "vibrant colors" description
- Using empty quality fluff ("masterpiece, stunning, 8k") in place of concrete detail (acceptable only as a short suffix for photoreal/3D styles)
- Inventing text or logos that are blurred or unreadable
- Claiming exact pixel dimensions or guaranteed pixel-perfect reproduction
- Reusing one prompt across multiple bulk images
- Ignoring aspect ratio/orientation
- Asking the user clarifying questions when an image is already supplied
- Pretending this skill itself implements the website feature without the integration build
Run before delivering every result:
- [ ] Image category correctly identified
- [ ] One dominant style stated (no style stacking)
- [ ] Subject, pose, position, proportions captured
- [ ] 3-6 HEX codes given as approximations
- [ ] Lighting and shadow type described from what is visible
- [ ] Background fully described
- [ ] Text transcribed verbatim or marked [illegible]
- [ ] Aspect ratio and orientation stated
- [ ] Master prompt is self-contained and in English
- [ ] No invented or beautified elements
- [ ] Negative prompt is image-specific
- [ ] 5-15 preservation details listed
- [ ] Confidence and limitations stated honestly
Use these to validate the skill:
- Flat vector hero illustration: Verify no outlines, correct HEX palette, floating UI element placement.
- Portrait photograph: Verify lens/depth-of-field language, lighting direction, color grade, no illustration terms.
- Logo on white background: Verify silhouette, geometry, stroke weight, transparent/white background handling, no invented gradient.
- Poster with text: Verify verbatim text, font category, hierarchy, text color and placement.
- 3D clay render: Verify material description, soft ambient occlusion, rounded forms, studio-style lighting.
- Blurry low-res thumbnail: Verify Low confidence, explicit limitations, no hallucinated fine details.
- Bulk of 3 mixed images: Verify three separate prompts with unique IDs and no shared boilerplate.
- Broken URL: Verify
IMAGE_INACCESSIBLEerror with no fabricated analysis.
If the skill file grows beyond ~500 lines in your deployment, split the Integration Guide and Test Cases into separate reference files and link to them from this one.