concept-to-image
Skill340 starsChanged 7 months agoMITView on GitHub
Turn concepts into static HTML visuals exported as PNG or SVG files via HTML/CSS/SVG. Triggers on: "create an image of", "export as PNG", "save as SVG", "concept to image", "screenshot this HTML". NOT for interactive HTML, use static-web-artifacts-builder.
- Installs packages
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 55
Read references/design-guide.md for detailed design patterns and anti-patterns.
- Very specific: line 59
Single file, self-contained: All CSS inline in <style>, all graphics as inline <svg>.
- Distinctive: line 61
Anti-AI-slop: Avoid centered-everything layouts, purple gradients, uniform rounded corners, and Inter/system font defaults.
- Distinctive: line 62
SVG-first for shapes: Use inline SVG for icons, connectors, shapes, and any element that should scale cleanly.
- Very specific: line 64
Start from the template: Use assets/template.html as the base structure.
- Very specific: line 120
SVG-native content: If the .canvas element contains a single root <svg>, extracts it directly as a clean SVG file.
- Distinctive: line 121
HTML-based content: If the content is CSS/HTML-heavy, falls back to PNG export with a note that true SVG requires SVG-native design.
- Distinctive: line 147
After a successful export, the script prints the output path and file stats:
- Distinctive: line 181
Display: Use SVG text with custom paths for display typography when needed
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Concept to Image
Creates polished visuals from concepts using HTML/CSS/SVG as a refineable intermediate, then exports to PNG or SVG.
Reference Files
| File | Purpose |
references/design-guide.md | Design patterns, anti-patterns, color palettes, typography choices, layout examples |
scripts/render_to_image.py | Playwright-based export script — takes HTML in, PNG or SVG out |
assets/template.html | Base HTML template with .canvas container and CSS custom properties pre-configured |
Why HTML as intermediate
HTML is the refineable layer between idea and image. Unlike direct canvas rendering, the user can see the HTML artifact, request changes ("make the title bigger", "swap the colors", "add a third column"), and only export once satisfied. This makes the workflow iterative and controllable.
Workflow
Concept → HTML artifact (view + refine) → PNG or SVG export- Interpret the user's concept — determine what kind of visual best fits (diagram, infographic, card, chart, etc.)
- Design a self-contained HTML file using inline CSS and inline SVG — zero external dependencies
- Present the HTML as an artifact so the user can preview and request refinements
- Iterate on the HTML based on user feedback (colors, layout, content, sizing)
- Export to PNG and/or SVG when the user is satisfied, using
scripts/render_to_image.py
Step 1: Interpret the concept
Determine the best visual format:
| User intent | Visual format | Approach |
| Explain a process/flow | Flowchart or pipeline diagram | SVG paths + boxes |
| Compare items | Side-by-side or matrix | CSS Grid |
| Show hierarchy | Tree or layered diagram | Nested containers + SVG connectors |
| Present data | Chart or infographic | SVG shapes + data labels |
| Social/marketing graphic | Card or poster | Typography-forward HTML/CSS |
| Icon, logo, badge | Compact symbol | Pure SVG |
| Educational concept | Annotated diagram | SVG + positioned labels |
Step 2: Design the HTML
Read references/design-guide.md for detailed design patterns and anti-patterns.
Core rules:
- Single file, self-contained: All CSS inline in
<style>, all graphics as inline<svg>. No external resources. - Fixed viewport: Set explicit
widthandheighton the root container matching the intended export size. This is critical — Playwright screenshots the element at this exact size. - Anti-AI-slop: Avoid centered-everything layouts, purple gradients, uniform rounded corners, and Inter/system font defaults. See design guide for alternatives.
- SVG-first for shapes: Use inline SVG for icons, connectors, shapes, and any element that should scale cleanly. CSS for layout and typography.
- Color with intention: 3-4 hues max + neutrals. Define as CSS custom properties. Every color encodes meaning.
- Start from the template: Use
assets/template.htmlas the base structure.
Sizing guidelines
| Use case | Recommended size |
| Social media graphic | 1200×630 |
| Infographic (portrait) | 800×1200 |
| Presentation slide | 1920×1080 |
| Square post | 1080×1080 |
| Icon/badge | 256×256 or 512×512 |
| Wide diagram | 1600×900 |
Set the .canvas container to the chosen size. The export script captures this element.
Step 3: Present and iterate
Present the HTML file to the user. They'll see it rendered as an artifact. Common refinement requests:
- Color/theme changes → update CSS custom properties
- Layout adjustments → modify grid/flexbox
- Content changes → edit text/SVG elements
- Size changes → update
.canvasdimensions
Each iteration is a quick HTML edit, not a full re-render. This is the key advantage over direct image generation.
Step 4: Export to image
Once the user is satisfied, run the export script:
python3 scripts/render_to_image.py <input.html> <output.png|.svg> [--width 1200] [--height 630] [--scale 2] [--selector ".canvas"]Parameters
| Param | Default | Description |
input | (required) | Path to HTML file |
output | (required) | Output path. Extension determines format (.png or .svg) |
--width | auto | Viewport width (overrides HTML-defined size) |
--height | auto | Viewport height (overrides HTML-defined size) |
--scale | 2 | Device scale factor for PNG (2 = retina quality) |
--selector | .canvas | CSS selector for the element to capture |
--full-page | false | Capture the full page instead of a specific element |
PNG export
Uses Playwright to launch headless Chromium and screenshot the .canvas element at the specified scale factor. Scale 2 produces retina-quality output (e.g., 1200×630 CSS pixels → 2400×1260 PNG ≈ 3.02 MP).
Opus 4.7 feedback loop: Retina-scale exports (e.g., 2400×1260) fit within Opus 4.7's ~3.75 MP vision ceiling, so you can feed the rendered PNG back to the model for iterate-by-critique loops without downsampling. Under Opus 4.6 these outputs would have been downscaled on ingestion.
SVG export
Two strategies, chosen automatically:
- SVG-native content: If the
.canvaselement contains a single root<svg>, extracts it directly as a clean SVG file. This produces a true vector SVG. - HTML-based content: If the content is CSS/HTML-heavy, falls back to PNG export with a note that true SVG requires SVG-native design. The script will warn and suggest redesigning with SVG elements if vector output is needed.
Delivering the output
Present the output file to the user. Always deliver both the HTML (for future editing) and the image (final output).
Error Handling
| Error | Cause | Resolution |
playwright not found | Playwright package not installed | Run npx playwright install chromium or pip install playwright && playwright install chromium |
| Browser launch failure | Headless Chromium fails to start | Verify --headless mode is supported; check available memory (Chromium needs ~200 MB) |
.canvas selector not found | HTML does not contain an element matching .canvas | Verify assets/template.html was used as the base; check the root container has class="canvas" |
| Render timeout | Complex HTML takes too long to render before screenshot | Increase the timeout via --timeout flag in the script, or simplify the HTML (reduce DOM depth, inline fewer SVGs) |
| SVG export falls back to PNG | .canvas element contains HTML/CSS content, not a root SVG | See SVG export section; redesign with a single root <svg> if vector output is required |
Limitations
- Playwright + Chromium required — the export script cannot run without a working Chromium installation.
- macOS and Linux only for headless browser export. Windows Subsystem for Linux works; native Windows Playwright may require separate setup.
- SVG export is best-effort — complex HTML/CSS layouts fall back to PNG. True vector SVG requires a single root
<svg>as the.canvaschild. - Max viewport 4096×4096 — Chromium refuses screenshots larger than this. Use
--scaleto achieve higher effective resolution within this limit. - No animation support — exported images are static snapshots. CSS animations and JavaScript-driven transitions are frozen at their initial state.
Output Example
After a successful export, the script prints the output path and file stats:
Exported: concept-diagram.png
Size: 2400 × 1260 px (2× scale from 1200 × 630 canvas)
File size: ~180 KB
Format: PNG (RGBA)Filename pattern follows whatever was passed as the output argument. Typical file sizes:
- Simple diagrams (text + shapes): 80–200 KB
- Dense infographics with gradients: 300–600 KB
- Full 1920×1080 at 2× scale: 500 KB–1.5 MB
Design anti-patterns to avoid
These produce generic "AI-generated" looking output:
- Centered everything with equal spacing
- Purple/blue gradient backgrounds
- Uniform border-radius on all elements
- Generic icon libraries (use custom inline SVG)
- System font stack without typographic intention
- Drop shadows on everything
- Low information density (too much whitespace)
Font handling
Since this environment has limited font access, use web-safe font stacks with intentional fallbacks:
- Technical/mono:
'Courier New', 'Consolas', monospace - Clean sans:
'Helvetica Neue', 'Arial', sans-serif - Editorial serif:
'Georgia', 'Times New Roman', serif - Display: Use SVG text with custom paths for display typography when needed
In this repository94 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adr-writerSkill
- agent-builderSkill
- animateSkill
- api-docs-generatorSkill
- appraiseSkill
- architecture-diagramSkill
- architecture-reviewerSkill
- arxiv-figuresSkill
- arxiv-packageSkill
- arxiv-preflightSkill
- benchmark-runnerSkill
- changelog-composerSkill
- chart-claritySkill
- citation-auditSkill
- codebase-advisorSkill
- code-refinerSkill
- competitive-analyzerSkill
- debug-investigatorSkill
- decision-mapSkill
- dependency-auditSkill
- devils-advocateSkill
- domain-modelingSkill
- engineering-retroSkill
- env-validatorSkill
- estimate-calibratorSkill
- feasibility-assessorSkill
- figure-rhetoricSkill
- figure-table-qualitySkill
- filesystemSkill
- githubSkill
- gpu-optimizerSkill
- handoffSkill
- html-presentationSkill
- html-videoSkill
- humanizeSkill
- idea-validatorSkill
- immuneSkill
- intakeSkill
- kg-builderSkill
- launch-videoSkill
- learning-workspaceSkill
- lightpanda-browserSkill
- linkedin-post-styleSkill
- literature-reviewSkill
- manuscript-provenanceSkill
- manuscript-reviewSkill
- manuscript-typographySkill
- market-analyzerSkill
- marp-slidesSkill
- mcp-to-skillSkill
- md-to-pdfSkill
- migration-risk-analyzerSkill
- milestone-runnerSkill
- module-deepeningSkill
- notebooklmSkill
- package-evaluatorSkill
- package-optimizerSkill
- paper-to-skillSkill
- plan-promptsSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

