explaingit

emilwallner/screenshot-to-code

Analysis updated 2026-06-24

16,482HTMLAudience · researcherComplexity · 4/5Setup · hard

TLDR

Research neural net that turns a design screenshot into HTML and CSS. Encoder decoder model in Keras with three sample versions ending in a Bootstrap output.

Mindmap

mindmap
  root((screenshot-to-code))
    Inputs
      Mockup screenshot
      Training image and code pairs
    Outputs
      Generated HTML and CSS
      Bootstrap component markup
    Use Cases
      Experiment with image to code AI
      Learn encoder decoder models
      Prototype design to code workflows
    Tech Stack
      Python
      Keras
      Jupyter
      Bootstrap
Click or tap to explore — scroll the page freely

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

Train the model on your own mockup and HTML pairs

USE CASE 2

Run the Bootstrap notebook to convert sample screenshots into HTML

USE CASE 3

Study an encoder decoder architecture for image to code

USE CASE 4

Adapt the pipeline for a different target language like JSX

What is it built with?

PythonKerasJupyterTensorFlow

How does it compare?

emilwallner/screenshot-to-codewindmill-labs/windmilltrycua/cua
Stars16,48216,46916,526
LanguageHTMLHTMLHTML
Setup difficultyhardhardhard
Complexity4/54/54/5
Audienceresearcherops devopsresearcher

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

How do you get it running?

Difficulty · hard Time to first run · 1day+

Old Keras and TensorFlow versions plus a GPU make environment setup the main hurdle.

In plain English

This project is a neural network (an AI system modeled loosely on how the brain works) that takes a screenshot or design mockup image and automatically converts it into working HTML and CSS code, the markup languages used to build web pages. Instead of a designer handing a mockup to a developer who then manually translates it into code, this AI does that translation step automatically. The system is built in three stages. The simplest version (called "Hello World") handles basic layouts, the middle version works with raw HTML, and the most capable version uses a component framework called Bootstrap. The Bootstrap version achieves 97% accuracy and is the only one that can handle new, unseen design mockups reliably. It works by learning 16 design tokens, simplified labels for UI components, that it then translates into HTML and CSS. The model is built using Keras, a deep learning library, running on top of a Jupyter Notebook environment, which is an interactive coding tool popular in data science. It uses an encoder-decoder architecture: the encoder reads the design image, and the decoder generates code token by token. The best-performing model uses a GRU (a type of recurrent neural network unit) instead of an older variant called LSTM. You would use this project if you are a developer or researcher interested in experimenting with AI-driven front-end code generation, or if you want to learn how image-to-code translation models work. It is more of a research prototype than a production tool, the dataset it was trained on is small and homogeneous, so performance on complex real-world layouts may vary.

Copy-paste prompts

Prompt 1
Set up a Python env with Keras and Jupyter so I can run the Bootstrap notebook in Screenshot-to-code
Prompt 2
Walk me through the encoder decoder model in this repo and how the GRU decoder generates tokens
Prompt 3
Show me how to feed my own design mockup PNG into the trained Bootstrap model and get HTML out
Prompt 4
Extend the dataset generator to add new design tokens for a custom component

Frequently asked questions

What is screenshot-to-code?

Research neural net that turns a design screenshot into HTML and CSS. Encoder decoder model in Keras with three sample versions ending in a Bootstrap output.

What language is screenshot-to-code written in?

Mainly HTML. The stack also includes Python, Keras, Jupyter.

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

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is screenshot-to-code for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub emilwallner on gitmyhub

Verify against the repo before relying on details.