Readme
Layerize
Layerize takes a flat graphic image, detects text elements, and returns:
- A background image with text removed
- Structured text layer data (JSON) with font information, positioning, colors, and HTML overlay code
The text layer data includes:
- Text containers grouped by related items
- Font class detection (h1, h2, body, small)
- Span-level styling (color, bold, italic, underline, caps)
- Precise positioning (x, y, width, height, angle)
- Font candidates for each text element
- Ready-to-use HTML overlay (text_html)
Use cases
- Edit text in existing designs without recreating the layout
- Extract text layers for translation or localization
- Re-compose graphics with different fonts or colors
- Build design editing tools that understand text structure
Output format
The model returns two files:
- An image file (PNG) — the background with text removed
- A JSON file — the full API response including text_containers and text_html
Font overrides
You can override fonts per style class using the font_name_* parameters:
- font_name_h1 — heading 1 text
- font_name_h2 — heading 2 text
- font_name_body — body text
- font_name_small — small text