Skip to main content

Screenshot to design tokens — measured, not estimated

Datum extracts design tokens from a UI screenshot by measuring the pixels: every card, input and button becomes a surface token (fill, border, radius), every text line joins a type scale (size, weight, colour), and the page background is identified. The values are exact measurements, not a model’s estimates, and export cleanly to Tailwind or CSS variables.

Why “estimated” tokens aren’t good enough

Ask a vision model for a screenshot’s colours and you get approximations: #1a1a1a instead of #18181B, rounded-lg instead of 6px, border-gray-800 instead of 1px #27272A. Each is close; together they make a rebuild that never quite matches. Tokens are only useful if they are the real values.

What Datum measures

Surface tokens

UI surfaces are flat fills and thin borders. Datum segments the screenshot into regions of uniform colour, keeps the ones whose edges form rectangles, and samples just outside each fill to measure the border. Corner radius comes from the anti-aliased corner geometry. It found 89.9% of layout containers on our benchmark, including tables whose rows are split by dividers.

Typography tokens

Every text line gets a font size from glyph geometry (±1px for 93.1% of words), a weight class from stroke thickness, and an exact colour measured per RGB channel. Lines with the same values collapse into a compact type scale.

Structure

Tokens are linked to where they are used: a nested layout tree records which text sits in which card, with pixel bounds, so spacing and hierarchy survive the hand-off to your coding agent.

Example output

Page background: #09090B

| Token     | Background | Border            | Radius |
| surface-1 | #18181B    | 1px solid #27272A | 6px    |
| surface-2 | #F97316    | none              | 4px    |
| surface-3 | #121215    | 1px solid #27272A | 6px    |

How to extract tokens from your screenshot

  1. Drop a screenshot. Open the Datum converter and drop a PNG or JPEG of the UI.
  2. Extract text and regions. Run text extraction and region detection; Datum measures every surface and text line.
  3. Generate the prompt. The prompt’s Measured Design Tokens section lists surface tokens and the type scale.
  4. Map to your theme. Paste the tokens into tailwind.config or CSS variables, or let your coding agent map them onto existing tokens.

Limits

  • Font family can’t be identified from pixels — use your project’s font.
  • Shadows, gradients and photos are not turned into tokens.
  • Lossy JPEG compression slightly shifts colours; PNG screenshots give exact values.

Questions

What design tokens can be extracted from a screenshot?
Surface tokens (background colour, border colour and width, corner radius), the page background, a type scale (font size, weight, text colour) and per-element bounds. Spacing can be derived from the bounds. Font family, shadows and motion cannot be measured from a still image.
How is this different from AI design-token extractors?
Most screenshot extractors ask a vision model to read the image and label the values as estimates. Datum measures them from the pixels: surface colours were exact and 98.6% of text colours were within ΔE 3 on our benchmark.
Can I export the tokens to Tailwind?
Yes. The tokens are plain hex values and pixel sizes, so they map directly to a Tailwind theme or CSS custom properties. The generated prompt asks your coding agent to reuse your existing tokens where they already match.