Claude-skill-registry-data marp-image-generator
Generate optimized images for Marp slides using Playwright MCP with theme-matching color palettes and guideline-compliant sizes
git clone https://github.com/majiayu000/claude-skill-registry-data
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry-data "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/marp-image-generator" ~/.claude/skills/majiayu000-claude-skill-registry-data-marp-image-generator && rm -rf "$T"
data/marp-image-generator/SKILL.mdMarp Image Generator Skill
Overview
This skill generates images optimized for Marp presentations (16:9 format) using Playwright MCP. It creates HTML-based diagrams with theme-matching color palettes (canyon-custom or github-dark) and converts them to PNG screenshots at guideline-compliant sizes.
When to Use
- User needs to create diagrams, charts, or visual content for Marp slides
- User wants images that match the presentation theme (canyon-custom or github-dark)
- User requires specific sizes following the Marp image size guideline
- User needs comparison charts, info panels, or process diagrams
Workflow
Step 1: Determine Image Specifications
Image Size Reference (from
docs/spec/marp/image-size-guideline.md):
| Use Case | Recommended Size | Aspect Ratio |
|---|---|---|
| Full-size image | 1216px × 582px | 2.09:1 |
| Safe area (recommended) | 1100px × 550px | 2:1 |
| 16:9 image | 1034px × 582px | 16:9 |
| Two-column (per image) | 550px × 400px | 1.375:1 |
| imageCenter | 900px × 600px | 3:2 |
| imageFull | 1280px × 720px | 16:9 |
| Retina (2x) | 2200px × 1100px | 2:1 |
Most Common Use Cases:
- General diagrams: 1100px × 550px (safe area)
- Comparison layouts: 550px × 400px (two-column)
- Full-screen impact: 1280px × 720px (imageFull)
Step 2: Select Color Theme
Canyon-Custom Theme Colors:
- Primary:
(yellow-green)#d4ed00 - Secondary:
(dark gray)#333333 - Accent:
(cyan)#00bcd4 - Background:
(white)#ffffff - Box colors:
- Blue box:
border on#d4ed00
background#f0f7d8 - Green box:
border on#01ad09
background#dbecdc - Yellow box:
border on#b47800
background#f5f0c6 - Red box:
border on#ad0140
background#f0dce3
- Blue box:
GitHub-Dark Theme Colors:
- Primary BG:
#0d1117 - Secondary BG:
#161b22 - Tertiary BG:
#21262d - Text Primary:
#f0f6fc - Text Secondary:
#7d8590 - Border:
#30363d - Accent:
(blue)#1f6feb - Success:
(green)#238636 - Danger:
(red)#da3633 - Warning:
(yellow)#9e6a03
Design Principle: NO GRADIENTS - Use solid colors and subtle color variations only
Step 3: Create HTML Diagram
HTML files should be saved to
application/marp/src/html/ with this template:
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Diagram Title</title> <script src="https://cdn.tailwindcss.com"></script> <script> tailwind.config = { theme: { extend: { fontFamily: { 'sans': ['"Hiragino Sans"', '"ヒラギノ角ゴシック"', '"Yu Gothic"', '"游ゴシック"', '"Noto Sans JP"', 'sans-serif'] }, colors: { // Canyon-Custom theme colors 'canyon-primary': '#d4ed00', 'canyon-secondary': '#333333', 'canyon-accent': '#00bcd4', 'canyon-bg': '#ffffff', 'canyon-box-blue': '#f0f7d8', 'canyon-box-green': '#dbecdc', 'canyon-box-yellow': '#f5f0c6', 'canyon-box-red': '#f0dce3', // GitHub-Dark theme colors 'gh-bg-primary': '#0d1117', 'gh-bg-secondary': '#161b22', 'gh-bg-tertiary': '#21262d', 'gh-text-primary': '#f0f6fc', 'gh-text-secondary': '#7d8590', 'gh-border': '#30363d', 'gh-accent': '#1f6feb', 'gh-success': '#238636', 'gh-danger': '#da3633', 'gh-warning': '#9e6a03', } } } } </script> <style> body { width: 1100px; /* Adjust based on target size */ height: 550px; } </style> </head> <body class="bg-white font-sans flex items-center justify-center p-10"> <!-- Canyon-Custom example --> <!-- For GitHub-Dark: change class to "bg-gh-bg-primary text-gh-text-primary" --> <div class="w-full h-full"> <!-- Diagram content here --> </div> </body> </html>
Naming Convention: Use snake_case (e.g.,
comparison_chart.html, workflow_diagram.html)
Step 4: Open in Browser and Resize
Use Playwright MCP:
Navigate to: file:///home/node/workspace/application/marp/src/html/[filename].html
Browser Resize (set body width/height to match target dimensions):
- For 1100×550: body width=1100px, height=550px
- For 1280×720: body width=1280px, height=720px
- Browser viewport can be larger (e.g., 1920×1080)
Step 5: Take Screenshot
Use
mcp__playwright__browser_take_screenshot:
:filenameapplication/marp/src/assets/[diagram-name].png
:typepng
:fullPage
(capture viewport only for exact size)false
IMPORTANT - Move to Correct Location: After taking screenshot, ALWAYS move from Playwright MCP directory to assets directory:
mv /home/node/workspace/.playwright-mcp/application/marp/src/assets/[diagram-name].png /home/node/workspace/application/marp/src/assets/[diagram-name].png
Step 6: Use in Marp Slides

Design Templates
Template 1: Two-Column Comparison (Canyon-Custom)
Target Size: 1100px × 550px Use Case: Before/After, Pros/Cons
<body class="bg-white text-canyon-secondary font-sans flex items-center justify-center p-10"> <div class="w-full h-full flex gap-10"> <div class="flex-1 border-3 border-canyon-primary bg-canyon-box-blue p-8 flex flex-col rounded-lg"> <h2 class="text-canyon-primary text-3xl font-bold mb-5 border-b-2 border-canyon-primary pb-2"> Before </h2> <ul class="list-none text-xl leading-relaxed space-y-2"> <li class="flex items-start"> <span class="text-canyon-primary mr-3">●</span> <span>Item 1</span> </li> <li class="flex items-start"> <span class="text-canyon-primary mr-3">●</span> <span>Item 2</span> </li> <li class="flex items-start"> <span class="text-canyon-primary mr-3">●</span> <span>Item 3</span> </li> </ul> </div> <div class="flex-1 border-3 border-canyon-primary bg-canyon-box-blue p-8 flex flex-col rounded-lg"> <h2 class="text-canyon-primary text-3xl font-bold mb-5 border-b-2 border-canyon-primary pb-2"> After </h2> <ul class="list-none text-xl leading-relaxed space-y-2"> <li class="flex items-start"> <span class="text-canyon-primary mr-3">●</span> <span>Item 1</span> </li> <li class="flex items-start"> <span class="text-canyon-primary mr-3">●</span> <span>Item 2</span> </li> <li class="flex items-start"> <span class="text-canyon-primary mr-3">●</span> <span>Item 3</span> </li> </ul> </div> </div> </body>
Template 2: Info Panel (GitHub-Dark)
Target Size: 1100px × 550px Use Case: Feature highlights, key points
<body class="bg-gh-bg-primary text-gh-text-primary font-sans flex items-center justify-center p-10"> <div class="w-full h-full flex items-center justify-center"> <div class="bg-gh-bg-secondary border-2 border-gh-accent border-l-8 p-10 rounded-lg max-w-4xl"> <h1 class="text-gh-accent text-5xl font-bold mb-8"> Key Features </h1> <ul class="list-none text-3xl leading-loose space-y-4"> <li class="flex items-start"> <span class="text-gh-success text-4xl mr-4">✓</span> <span>Feature 1</span> </li> <li class="flex items-start"> <span class="text-gh-success text-4xl mr-4">✓</span> <span>Feature 2</span> </li> <li class="flex items-start"> <span class="text-gh-success text-4xl mr-4">✓</span> <span>Feature 3</span> </li> </ul> </div> </div> </body>
Template 3: Process Steps (Canyon-Custom)
Target Size: 1100px × 550px Use Case: Workflow, step-by-step guide
<body class="bg-white text-canyon-secondary font-sans flex items-center justify-center p-10"> <div class="w-full h-full flex items-center justify-between px-5"> <div class="flex-1 text-center p-5"> <div class="w-20 h-20 bg-canyon-primary text-canyon-secondary rounded-full flex items-center justify-center text-4xl font-bold mx-auto mb-5"> 1 </div> <div class="text-2xl font-bold mb-2">Plan</div> <div class="text-lg text-gray-600">Define requirements</div> </div> <div class="text-6xl text-canyon-accent">→</div> <div class="flex-1 text-center p-5"> <div class="w-20 h-20 bg-canyon-primary text-canyon-secondary rounded-full flex items-center justify-center text-4xl font-bold mx-auto mb-5"> 2 </div> <div class="text-2xl font-bold mb-2">Build</div> <div class="text-lg text-gray-600">Implement features</div> </div> <div class="text-6xl text-canyon-accent">→</div> <div class="flex-1 text-center p-5"> <div class="w-20 h-20 bg-canyon-primary text-canyon-secondary rounded-full flex items-center justify-center text-4xl font-bold mx-auto mb-5"> 3 </div> <div class="text-2xl font-bold mb-2">Test</div> <div class="text-lg text-gray-600">Verify quality</div> </div> </div> </body>
Template 4: Centered Message (GitHub-Dark)
Target Size: 1280px × 720px (imageFull) Use Case: Section divider, key message
<style> body { width: 1280px; height: 720px; } </style> </head> <body class="bg-gh-bg-primary text-gh-text-primary font-sans flex items-center justify-center"> <div class="h-full flex flex-col items-center justify-center text-center"> <h1 class="text-7xl font-bold mb-8 text-gh-text-primary"> Main Message </h1> <div class="w-52 h-1.5 bg-gh-accent my-8"></div> <p class="text-4xl text-gh-text-secondary max-w-4xl"> Supporting description goes here </p> </div> </body>
Design Guidelines
Color Usage Rules
Canyon-Custom Theme:
- Primary accent:
(use for borders, headings, icons)#d4ed00 - Secondary accent:
(use for highlights, links)#00bcd4 - Background:
or light tints (#ffffff
,#f0f7d8
)#dbecdc - Text:
(dark gray, never pure black)#333333
GitHub-Dark Theme:
- Primary accent:
(use for borders, headings, links)#1f6feb - Success/positive:
(use for checkmarks, success states)#238636 - Warning:
(use for caution, alerts)#9e6a03 - Danger:
(use for errors, critical info)#da3633 - Background: Layer with
,#0d1117
,#161b22#21262d - Text:
(primary),#f0f6fc
(secondary)#7d8590
Typography
- Heading sizes: 32px - 72px
- Body text: 18px - 28px
- Small text: 14px - 16px
- Font weight: Normal (400) or Bold (600-700)
Spacing
- Padding: 20px - 40px
- Gaps: 20px - 40px
- Margins: 10px - 30px
- Border width: 2px - 8px
No Gradient Policy
Avoid:
- ❌
linear-gradient() - ❌
radial-gradient() - ❌ Multiple color stops
Use Instead:
- ✅ Solid colors
- ✅ Layered backgrounds with different opacity
- ✅ Adjacent color blocks
User Request Templates
Template: Create Diagram
Create a Marp image diagram using the marp-image-generator skill. **Content**: - Type: [comparison / info-panel / process / message] - Title: [Title] - Elements: - [Element 1] - [Element 2] - [Element 3] **Theme**: [canyon-custom / github-dark] **Size**: [1100x550 / 1280x720 / 550x400] **Reference**: @docs/spec/marp/image-size-guideline.md **Output**: - HTML: application/marp/src/html/[filename].html - PNG: application/marp/src/assets/[filename].png
Troubleshooting
Issue 1: Colors Don't Match Theme
Cause: Using incorrect color codes
Solution:
- Refer to theme CSS files:
- Canyon-Custom:
application/marp/theme/canyon-custom.css - GitHub-Dark:
application/marp/theme/github-dark.css
- Canyon-Custom:
- Use exact hex codes from color palette
Issue 2: Image Size Incorrect
Cause: Body dimensions not matching target size
Solution:
- Set
to exact target dimensionsbody { width: XXXpx; height: YYYpx; } - Use
when taking screenshotfullPage: false
Issue 3: Text Too Small/Large
Cause: Font sizes not optimized for target dimensions
Solution:
- For 1100×550: Use 24-36px for headings, 18-24px for body
- For 1280×720: Use 48-72px for headings, 28-36px for body
- Test and adjust based on visual balance
Issue 4: Gradients Detected
Cause: Using
linear-gradient() or radial-gradient()
Solution:
- Replace with solid colors
- Use layered
elements with different background colors<div> - Use border colors for visual separation
Best Practices
- Use Tailwind CSS: Leverage Tailwind utility classes for faster development
- Custom Theme Colors: Use the extended color palette (canyon-, gh-) for theme consistency
- Keep It Simple: One diagram = one concept
- Color Consistency: Stick to theme palette
- Size Accuracy: Match exact dimensions from guideline (1100×550 default)
- No Gradients: Use solid colors and borders only
- Move to Correct Location: Always move (not copy) from
to.playwright-mcp/
to keep directories cleanapplication/marp/src/assets/ - Test on Slide: Verify the image looks good in actual Marp presentation
Related Resources
- Image Size Guideline:
docs/spec/marp/image-size-guideline.md - Marp Implementation Guide:
application/marp/CLAUDE.md - Theme Files:
application/marp/theme/ - Existing HTML Examples:
application/marp/src/html/ - Playwright MCP Setup:
docs/features/tool-playwright-mcp-setup/
Permissions Required
This skill requires Playwright MCP configured in
.mcp.json:
{ "mcpServers": { "playwright": { "type": "stdio", "command": "npx", "args": ["@playwright/mcp@latest", "--headless", "--isolated"] } } }