imgtohtml
by @jinqiu193
Convert UI screenshots/images into fully functional HTML/CSS copies. This skill is used when a user provides images of a website, application interface, dash...
clawhub install imgtohtmlπ About This Skill
name: img2html description: "Convert UI screenshots/images into fully functional HTML/CSS copies. This skill is used when a user provides images of a website, application interface, dashboard, or any UI design and wants to recreate it as working HTML code with accurate styles, layout, and visual details." license: Complete terms in LICENSE.txt
This skill converts UI screenshots or design images into production-ready HTML/CSS code that accurately replicates the visual appearance and layout of the original.
The user provides an image (screenshot, mockup, or design reference) showing a UI interface they want replicated.
Analysis Process
First, carefully analyze the image to understand:
1. Layout Structure - Identify sections, containers, and nesting hierarchy - Determine grid/flexbox patterns needed - Note spacing relationships and alignment
2. Visual Elements - Colors (hex/rgb values from the image) - Typography (font families, sizes, weights) - Icons and imagery - Borders, shadows, gradients, effects
3. Component Types - Headers, navigation, cards, buttons, inputs, tables, etc. - Interactive elements and their states - Data displays, labels, badges
4. Responsive Behavior - How the layout might adapt to different screen sizes - Mobile-first or desktop-first approach
Implementation Guidelines
HTML Structure:
CSS Styling:
Layout Techniques:
Interactive Elements:
Output Format
Provide a complete, self-contained HTML file with:
tags (or separate CSS file if complex)If the design is complex, you may split into multiple files (HTML, CSS, JS).
Accuracy Priorities
1. Visual Fidelity: Match the original image as closely as possible 2. Proportions: Maintain correct size ratios between elements 3. Colors: Use exact or nearest-match color values 4. Typography: Match font styles accurately 5. Spacing: Replicate padding, margins, and gaps faithfully
Limitations to Communicate
Multi-Image Handling
When the user provides multiple images at once, process each image individually and sequentially to ensure maximum quality:
Sequential Processing Workflow:
1. Process ONE image at a time through the complete conversion pipeline 2. For each image: - Analyze its unique layout, colors, typography, and components - Create a dedicated HTML/CSS replica - Verify visual fidelity before moving to the next 3. Maintain consistent naming conventions across all generated files 4. After processing all images, provide a summary of all converted files
Output Organization:
login-page.html, dashboard.html)Quality Assurance:
Example Workflow
1. User provides UI screenshot(s) 2. For each image: - Analyze layout, colors, typography, components - Create HTML structure matching the hierarchy - Apply CSS to replicate visual appearance - Add polish (hover states, transitions, responsive considerations) 3. Deliver complete HTML file(s) - one per input image (or split logically for multi-page designs)
Remember: The goal is a pixel-perfect replica that functions as a real web page, not just a close approximation. Pay attention to details like shadows, borders, gradients, and spacing - these make the difference between "close" and "indistinguishable."