pith. sign in

arxiv: 2406.16386 · v3 · pith:HVXOGWOUnew · submitted 2024-06-24 · 💻 cs.SE · cs.AI

Automatically Generating UI Code from Screenshot: A Divide-and-Conquer-Based Approach

classification 💻 cs.SE cs.AI
keywords codedcgengeneratingapproachelementvisualconductconverting
0
0 comments X
read the original abstract

Websites are critical in today's digital world, with over 1.11 billion currently active and approximately 252,000 new sites launched daily. Converting website layout design into functional UI code is a time-consuming yet indispensable step of website development. Manual methods of converting visual designs into functional code present significant challenges, especially for non-experts. To explore automatic design-to-code solutions, we first conduct a motivating study on GPT-4o and identify three types of issues in generating UI code: element omission, element distortion, and element misarrangement. We further reveal that a focus on smaller visual segments can help multimodal large language models (MLLMs) mitigate these failures in the generation process. In this paper, we propose DCGen, a divide-and-conquer-based approach to automate the translation of webpage design to UI code. DCGen starts by dividing screenshots into manageable segments, generating code for each segment, and then reassembling them into complete UI code for the entire screenshot. We conduct extensive testing with a dataset comprised of real-world websites and various MLLMs and demonstrate that DCGen achieves up to a 15% improvement in visual similarity and 8% in code similarity for large input images. Human evaluations show that DCGen can help developers implement webpages significantly faster and more similar to the UI designs. To the best of our knowledge, DCGen is the first segment-aware MLLM-based approach for generating UI code directly from screenshots.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 4 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. SPRITE: From Static Mockups to Engine-Ready Game UI

    cs.HC 2026-03 unverdicted novelty 7.0

    SPRITE converts static game UI screenshots into editable engine-ready assets by using VLMs to parse complex layouts into a YAML intermediate representation.

  2. Self-Distillation Policy Optimization via Visual Feedback: Bridging Code and Visual Artifacts

    cs.AI 2026-06 unverdicted novelty 6.0

    Visual-SDPO distills visual feedback from rendered code outputs into a student policy via grounded credit weighting and GRPO, yielding over 10-point gains on chart/UI/slide benchmarks.

  3. Porting Declarative UI to HarmonyOS: A Heuristic-guided LLM Approach

    cs.SE 2026-06 unverdicted novelty 6.0

    ArkTrans achieves up to 90.67% compilable ArkUI translations from KJC/SwiftUI using heuristic LLM guidance and empirical post-fixing rules, versus 0% for direct or one-shot prompting on a 100-sample benchmark.

  4. InternLM-XComposer-2.5: A Versatile Large Vision Language Model Supporting Long-Contextual Input and Output

    cs.CV 2024-07 conditional novelty 5.0

    InternLM-XComposer-2.5 is a 7B vision-language model supporting up to 96K context that reaches GPT-4V-level performance on image, video, and multi-turn tasks and adds LoRA-driven text-image composition capabilities.