Générateur d'images

VérifiéPrudence

Rend HTML/CSS en images prêtes pour la production via Playwright. Capture des captures d'écran parfaites de modèles HTML.

Spar Skills Guide Bot
ContenuIntermédiaire
24/07/2026
Claude CodeCursorWindsurfCodex
#html-to-image#playwright#screenshot-rendering#social-graphics#carousel-generation

Recommandé pour

Synthèse automatique

Ce skill transforme du HTML/CSS autonome en images PNG via un navigateur headless Playwright, à la dimension de viewport demandée.

Points forts

  • Rendu pixel-perfect grâce à un vrai moteur de navigateur, donc fidèle au CSS écrit
  • Presets de viewports prêts à l'emploi pour Instagram, X, LinkedIn, YouTube, Facebook
  • Gestion explicite du rendu par lot (carrousels) avec un seul serveur HTTP démarré puis arrêté
  • Workflow en boucle avec vérification visuelle de la capture avant validation

Limites

  • Le skill ne conçoit pas le visuel : tout le design doit être fourni dans le HTML, sinon il n'y a rien à rendre
  • Dépend d'un serveur MCP Playwright et d'un serveur HTTP local (python -m http.server) disponibles dans l'environnement
  • Aucune mention de rendu multi-format ou de retouche d'image après capture ; un résultat raté impose de réécrire le HTML
Quand l'utiliser

À utiliser lorsqu'un template HTML/CSS existe déjà et qu'il faut en produire des images nettes aux dimensions exactes des réseaux sociaux.

Quand l'éviter

À éviter si vous cherchez un outil de design génératif ou d'édition d'images bitmap sans passer par du code HTML.

Analyse de sécurité

Prudence
Score qualité88/100

The skill uses bash, a local HTTP server, curl, and process termination for a legitimate rendering workflow. There is no destructive, exfiltration, or obfuscated behavior, but the use of background processes and pkill warrants caution.

Points d'attention
  • •Instructs starting a local HTTP server with `python -m http.server` and backgrounding it.
  • •Uses `curl` in a retry loop to wait for the server.
  • •Uses `pkill -f "http.server 8765"` to stop the server, which could match unrelated processes containing that string.
Comment cette analyse est faite

Exemples

Instagram carousel
Create a 5-slide Instagram carousel (1080x1440) about our new pricing tiers. Write one self-contained HTML file per slide, render each to PNG with Playwright, and show me the screenshots so I can approve them.
Social post graphic
Turn this quote into a 1200x675 Twitter/X post image: build the HTML with inline CSS, serve it locally, screenshot it at that viewport, and verify the text isn't clipped.
YouTube thumbnail
Generate a 1280x720 YouTube thumbnail from these title and subtitle lines, render it headless, and re-render if any element overflows the frame.

name: image-creator description: > Renders HTML/CSS into production-ready images via Playwright. Accepts complete HTML content, opens it in a headless browser at the specified viewport, and captures a pixel-perfect screenshot. Generic engine -- any visual format is defined by the HTML template. description_pt-BR: > Renderiza HTML/CSS em imagens prontas para produção via Playwright. Aceita conteúdo HTML completo, abre em um navegador headless na viewport especificada e captura uma screenshot pixel-perfect. Motor genérico -- qualquer formato visual é definido pelo template HTML. description_es: > Renderiza HTML/CSS en imágenes listas para producción vía Playwright. Acepta contenido HTML completo, lo abre en un navegador headless en el viewport especificado y captura una screenshot pixel-perfect. Motor genérico -- cualquier formato visual se define por el template HTML. type: mcp version: "1.0.0" mcp: server_name: playwright categories: [design, automation, images]

Image Creator

When to use

Use the Visual Renderer when you need to generate production-ready images from HTML/CSS. This skill uses Playwright to render complete, self-contained HTML files in a headless browser and capture pixel-perfect screenshots. It is the primary engine for creating social media graphics, carousel slides, infographics, and any other visual content defined by HTML templates.

Instructions

Core Workflow

  1. Generate HTML -- Write a complete, self-contained HTML file with inline CSS. The HTML IS the design -- all styling, layout, fonts, colors, and content must be embedded.

  2. Save HTML -- Write the HTML file to the squad's output folder (e.g., output/slides/slide-01.html)

  3. Start HTTP server -- Before rendering, start a local HTTP server in the squad's output folder:

    python -m http.server 8765 --directory "OUTPUT_DIR" &
    for i in $(seq 1 30); do curl -s http://localhost:8765 > /dev/null 2>&1 && break || sleep 0.1; done
    

    Replace OUTPUT_DIR with the actual absolute path to the output folder (quote paths that contain spaces).

  4. Render -- Use Playwright to:

    • browser_navigate to http://localhost:8765/slide-01.html (filename only, not full path)
    • browser_resize to target viewport dimensions
    • browser_take_screenshot to save as PNG
  5. Verify -- Read the screenshot to confirm quality. Re-render if needed.

  6. Stop server -- After all slides are rendered, stop the HTTP server:

    pkill -f "http.server 8765" 2>/dev/null || true
    

Viewport Presets (width x height)

Use these standard dimensions:

  • Instagram Post: 1080 x 1080
  • Instagram Carousel: 1080 x 1440
  • Instagram Story/Reel: 1080 x 1920
  • Facebook Post: 1200 x 630
  • Twitter/X Post: 1200 x 675
  • LinkedIn Post: 1200 x 627
  • YouTube Thumbnail: 1280 x 720
  • Custom: as specified by the squad

HTML Template Guidelines

The HTML you generate MUST:

  • Be self-contained (inline CSS, no external dependencies)
  • Use web-safe fonts OR Google Fonts via @import
  • Embed images as absolute paths or base64 data URIs
  • Set exact body dimensions matching the viewport
  • Use margin: 0; padding: 0; overflow: hidden on body
  • Account for device pixel ratio if high-res needed

Example minimal structure:

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <style>
    * { margin: 0; padding: 0; box-sizing: border-box; }
    body { width: 1080px; height: 1440px; overflow: hidden; }
    /* ... your design ... */
  </style>
</head>
<body>
  <!-- Your content -->
</body>
</html>

Batch Rendering (Carousels/Multi-slide)

For multi-image outputs like carousels:

  1. Generate one HTML file per slide
  2. Start the HTTP server once before the batch (step 3 of Core Workflow)
  3. Render each slide sequentially (step 4 repeated per slide)
  4. Stop the HTTP server once after all slides are done (step 6 of Core Workflow)
  5. Name output files with zero-padded numbers: slide-01.png, slide-02.png, slide-03.png
  6. Keep all slides at the same viewport dimensions

Best Practices

  • Always verify the first rendered image before batch rendering
  • Use CSS Grid/Flexbox for layout -- most reliable across renderers
  • Avoid animations/transitions (static screenshot only)
  • For rounded corners on images, use CSS border-radius + overflow
  • For emoji rendering, rely on system fonts (Windows: Segoe UI Emoji)
  • Test text overflow -- ensure no content is clipped unexpectedly
  • Keep HTML files alongside output PNGs for easy re-rendering

Typography & Readability Rules

Text must be legible in the target platform's smallest viewing context (mobile feed for social platforms). Text inside linked or embedded image files (JPG, PNG, base64 assets) is decorative and exempt. All HTML text nodes and inline SVG text are subject to these rules.

These are HARD minimums -- never go below them for readable text.

Minimum Font Sizes by Platform

| Text Role | Instagram Post/Carousel | Instagram Story/Reel | LinkedIn/Facebook | YouTube Thumb | |------------------|------------------------|----------------------|-------------------|---------------| | Hero / Display | 58px | 56px | 40px | 60px | | Heading | 43px | 42px | 32px | 36px | | Body / Bullets | 34px | 32px | 24px | 36px | | Caption / Footer | 24px | 20px | 20px | 32px |

Universal rule: No text element meant to be read may use a font size smaller than 20px, on any platform.

Font Weight

  • Body text and above: use font-weight 500+ (medium/semibold/bold)
  • Caption text: font-weight 500+ strongly recommended; 400 only with explicit high-contrast background (4.5:1 ratio minimum)
  • Avoid thin/light weights (100-300) for any readable text

Verification Checklist

Before calling browser_take_screenshot, scan your HTML and confirm:

  • All text elements use explicit px sizes (not em/rem that could resolve smaller)
  • No heading is below the Heading minimum for the target platform
  • No body/bullet text is below the Body minimum
  • No footer or metadata text is below the Caption minimum
  • No readable text uses font-weight below 500 (caption at 400 only with 4.5:1 contrast background)

Available operations

  • Render HTML to PNG -- Convert self-contained HTML/CSS into a pixel-perfect screenshot
  • Batch Render -- Render multiple slides/pages sequentially for carousels and multi-image content
  • Viewport Resize -- Set precise viewport dimensions for any target platform
  • Quality Verification -- Visually inspect rendered output and re-render if needed

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/image-creator-mryiqhrb/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/image-creator-mryiqhrb' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/image-creator-mryiqhrb/download' --output '.skill-downloads/image-creator-mryiqhrb/SKILL.md.part' && mv '.skill-downloads/image-creator-mryiqhrb/SKILL.md.part' '.skill-downloads/image-creator-mryiqhrb/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/image-creator-mryiqhrb/SKILL.md' && test -s '.skill-downloads/image-creator-mryiqhrb/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/image-creator' && cp -R '.skill-downloads/image-creator-mryiqhrb' '.claude/skills/image-creator'

Cursor
test -f '.skill-downloads/image-creator-mryiqhrb/SKILL.md' && test -s '.skill-downloads/image-creator-mryiqhrb/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/image-creator' && cp -R '.skill-downloads/image-creator-mryiqhrb' '.cursor/skills/image-creator'

Codex
test -f '.skill-downloads/image-creator-mryiqhrb/SKILL.md' && test -s '.skill-downloads/image-creator-mryiqhrb/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/image-creator' && cp -R '.skill-downloads/image-creator-mryiqhrb' '.agents/skills/image-creator'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/image-creator-mryiqhrb'

openskills read 'image-creator-mryiqhrb'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/image-creator-mryiqhrb/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires