whatisgithub

What is image-to-code?

yuzhworkhard-wq/image-to-code — explained in plain English

Analysis updated 2026-05-18

94PythonAudience · developerComplexity · 2/5Setup · easy

In one sentence

A Codex skill that turns a UI screenshot or design file into scaled HTML/CSS plus sharp cut-out image assets.

Mindmap

mindmap
  root((image-to-code))
    What it does
      Design to HTML CSS
      Cuts image assets
      Figma export
    Tech stack
      Python
      Pillow
      NumPy
    Workflow
      750px reference grid
      Layer manifest JSON
      Asset audit and preview
    Use cases
      Rebuild a mobile screen
      Extract clean icons
      Import layout into Figma
    Audience
      Frontend developers
      Designers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Turn a design screenshot into working HTML and CSS that matches the layout

USE CASE 2

Cut clean, high-resolution transparent PNG assets out of a source design image

USE CASE 3

Audit generated image assets for transparency and edge quality before shipping

USE CASE 4

Reconstruct a design as editable layers inside Figma from an image

What is it built with?

PythonPillowNumPyHTMLCSSCodex

How does it compare?

yuzhworkhard-wq/image-to-codeai272/speakeragricidaniel/claude-shorts
Stars949493
LanguagePythonPythonPython
Setup difficultyeasymoderatemoderate
Complexity2/52/53/5
Audiencedeveloperpm founderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Requires Pillow and NumPy, and the skill must be copied into the Codex skills folder.

The README does not state a license.

So what is it?

This repository is a skill for Codex, an AI coding tool, that handles turning a UI image or design export into working front-end code. The core idea is that you hand the skill a screenshot or exported design file, and it produces HTML and CSS that recreates the visual layout, along with high-resolution image assets cut out of the original design. The workflow is built around a measurement system using 750 pixels as a fixed reference width. This baseline is not the final page width but a consistent coordinate grid used for measuring, positioning, and checking quality. Once the code is built at this 750-pixel reference size, an outer wrapper scales the whole layout proportionally to fit the actual screen width, which is typically a phone screen in the 320 to 430 pixel range. The skill does not reflow individual elements, it scales the entire artboard as a unit. For each design layer, the skill generates a manifest file called layers.manifest.json that records the position, size, z-order, and asset path of every element. Text and simple shapes are implemented in code directly. Icons, illustrations, avatars, and complex decorative elements are cut out of the source image as separate transparent PNG files at two, three, or four times the display density so they stay sharp on high-resolution screens. The repository includes Python scripts for extracting PNG assets from a source image with background removal, auditing those assets for correct transparency and edge quality, and previewing bounding boxes before cutting. After code and quality checks are done, the skill can also produce an output intended for import into Figma, reconstructing the layout as editable Figma layers rather than a flat image. The README is written in both Chinese and English. The Python scripts depend on Pillow and NumPy. Installation means copying the directory into the Codex skills folder and installing those two dependencies.

Copy-paste prompts

Prompt 1
Use the image-to-code skill to convert this screenshot into HTML and CSS
Prompt 2
Generate a layers.manifest.json for this design image and extract the icon assets
Prompt 3
Preview the bounding boxes for this design before cutting out the assets
Prompt 4
Take this converted layout and produce a Figma-importable version

Frequently asked questions

What is image-to-code?

A Codex skill that turns a UI screenshot or design file into scaled HTML/CSS plus sharp cut-out image assets.

What language is image-to-code written in?

Mainly Python. The stack also includes Python, Pillow, NumPy.

What license does image-to-code use?

The README does not state a license.

How hard is image-to-code to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is image-to-code for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.