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:
Layout Structure
- Identify sections, containers, and nesting hierarchy
- Determine grid/flexbox patterns needed
- Note spacing relationships and alignment
Visual Elements
- Colors (hex/rgb values from the image)
- Typography (font families, sizes, weights)
- Icons and imagery
- Borders, shadows, gradients, effects
Component Types
- Headers, navigation, cards, buttons, inputs, tables, etc.
- Interactive elements and their states
- Data displays, labels, badges
Responsive Behavior
- How the layout might adapt to different screen sizes
- Mobile-first or desktop-first approach
Implementation Guidelines
HTML Structure:
- Use semantic HTML5 elements (header, nav, main, section, article, footer)
- Create logical nesting that matches the visual hierarchy
- Use meaningful class names (BEM or similar convention)
CSS Styling:
- Replicate colors exactly using values from the image
- Match typography (font family, size, weight, line-height, letter-spacing)
- Recreate spacing (margins, padding, gaps) accurately
- Implement visual effects (box-shadow, border-radius, gradients, backdrop-filter)
- Use CSS variables for theming when appropriate
Layout Techniques:
- Flexbox for 1D layouts (rows or columns)
- CSS Grid for 2D layouts
- Position properties for overlays and absolute positioning
- Transform for rotations and scaling
Interactive Elements:
- Add :hover, :focus states for buttons and links
- Include transitions for smooth state changes
- Consider adding basic JavaScript if the UI implies interactivity
Output Format
Provide a complete, self-contained HTML file with:
- Proper DOCTYPE and HTML structure
- Embedded CSS in
<style> tags (or separate CSS file if complex)
- All necessary meta tags for viewport/responsiveness
- Comments explaining major sections if helpful
If the design is complex, you may split into multiple files (HTML, CSS, JS).
Accuracy Priorities
- Visual Fidelity: Match the original image as closely as possible
- Proportions: Maintain correct size ratios between elements
- Colors: Use exact or nearest-match color values
- Typography: Match font styles accurately
- Spacing: Replicate padding, margins, and gaps faithfully
Limitations to Communicate
- Exact font matching may require web fonts (Google Fonts, etc.)
- Some effects may be approximated if the exact technique isn't visible
- Interactive behavior beyond hover states requires user specification
- Dynamic content should be represented with placeholder data
Multi-Image Handling
When the user provides multiple images at once, process each image individually and sequentially to ensure maximum quality:
Sequential Processing Workflow:
- Process ONE image at a time through the complete conversion pipeline
- 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
- Maintain consistent naming conventions across all generated files
- After processing all images, provide a summary of all converted files
Output Organization:
- Name files descriptively based on each image's content (e.g.,
login-page.html, dashboard.html)
- If images represent different pages of the same site, maintain shared styles in a common CSS file when appropriate
- If images are unrelated, create self-contained HTML files for each
Quality Assurance:
- Do NOT batch-process images together - each deserves full analysis attention
- If images are related (e.g., different screens of the same app), note shared components and reuse CSS where sensible
- Communicate progress to the user as you work through each image
Example Workflow
- User provides UI screenshot(s)
- 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)
- 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."
1---2name: img2html3description: 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.4---56This skill converts UI screenshots or design images into production-ready HTML/CSS code that accurately replicates the visual appearance and layout of the original.78The user provides an image (screenshot, mockup, or design reference) showing a UI interface they want replicated.910## Analysis Process1112First, carefully analyze the image to understand:13141. **Layout Structure**15 16 - Identify sections, containers, and nesting hierarchy17 - Determine grid/flexbox patterns needed18 - Note spacing relationships and alignment19202. **Visual Elements**21 22 - Colors (hex/rgb values from the image)23 - Typography (font families, sizes, weights)24 - Icons and imagery25 - Borders, shadows, gradients, effects26273. **Component Types**28 29 - Headers, navigation, cards, buttons, inputs, tables, etc.30 - Interactive elements and their states31 - Data displays, labels, badges32334. **Responsive Behavior**34 35 - How the layout might adapt to different screen sizes36 - Mobile-first or desktop-first approach3738## Implementation Guidelines3940**HTML Structure:**4142- Use semantic HTML5 elements (header, nav, main, section, article, footer)43- Create logical nesting that matches the visual hierarchy44- Use meaningful class names (BEM or similar convention)4546**CSS Styling:**4748- Replicate colors exactly using values from the image49- Match typography (font family, size, weight, line-height, letter-spacing)50- Recreate spacing (margins, padding, gaps) accurately51- Implement visual effects (box-shadow, border-radius, gradients, backdrop-filter)52- Use CSS variables for theming when appropriate5354**Layout Techniques:**5556- Flexbox for 1D layouts (rows or columns)57- CSS Grid for 2D layouts58- Position properties for overlays and absolute positioning59- Transform for rotations and scaling6061**Interactive Elements:**6263- Add :hover, :focus states for buttons and links64- Include transitions for smooth state changes65- Consider adding basic JavaScript if the UI implies interactivity6667## Output Format6869Provide a complete, self-contained HTML file with:7071- Proper DOCTYPE and HTML structure72- Embedded CSS in `<style>` tags (or separate CSS file if complex)73- All necessary meta tags for viewport/responsiveness74- Comments explaining major sections if helpful7576If the design is complex, you may split into multiple files (HTML, CSS, JS).7778## Accuracy Priorities79801. **Visual Fidelity**: Match the original image as closely as possible812. **Proportions**: Maintain correct size ratios between elements823. **Colors**: Use exact or nearest-match color values834. **Typography**: Match font styles accurately845. **Spacing**: Replicate padding, margins, and gaps faithfully8586## Limitations to Communicate8788- Exact font matching may require web fonts (Google Fonts, etc.)89- Some effects may be approximated if the exact technique isn't visible90- Interactive behavior beyond hover states requires user specification91- Dynamic content should be represented with placeholder data9293## Multi-Image Handling9495When the user provides multiple images at once, process each image **individually and sequentially** to ensure maximum quality:9697**Sequential Processing Workflow:**98991. Process ONE image at a time through the complete conversion pipeline1002. For each image:101 - Analyze its unique layout, colors, typography, and components102 - Create a dedicated HTML/CSS replica103 - Verify visual fidelity before moving to the next1043. Maintain consistent naming conventions across all generated files1054. After processing all images, provide a summary of all converted files106107**Output Organization:**108109- Name files descriptively based on each image's content (e.g., `login-page.html`, `dashboard.html`)110- If images represent different pages of the same site, maintain shared styles in a common CSS file when appropriate111- If images are unrelated, create self-contained HTML files for each112113**Quality Assurance:**114115- Do NOT batch-process images together - each deserves full analysis attention116- If images are related (e.g., different screens of the same app), note shared components and reuse CSS where sensible117- Communicate progress to the user as you work through each image118119## Example Workflow1201211. User provides UI screenshot(s)1222. For each image:123 - Analyze layout, colors, typography, components124 - Create HTML structure matching the hierarchy125 - Apply CSS to replicate visual appearance126 - Add polish (hover states, transitions, responsive considerations)1273. Deliver complete HTML file(s) - one per input image (or split logically for multi-page designs)128129Remember: 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."