Pixel2Primitives: Geometry-Aware Reconstruction of Editable Scientific Figures

Jinhui Yin, Daozhu Dong, Yiqun Kou, Kehan Hu, Baoxiang Du, Xu He, Danni Yang, Erfei Cui, Guanzhou Chen, Yuanqi Li, Yanwen Guo, Zhihang Zhong, Lei Yang, Hongjie Zhang, Qi ZhangarXiv 2026

TL;DR

Ever needed to tweak a label or move an arrow in a scientific diagram, only to realize you’re stuck with a flat, uneditable PNG? Pixel2Primitives solves this by turning rasterized scientific figures into native, fully editable PowerPoint slides—preserving both crisp visual appearance and the underlying object structure.

What Problem Does This Paper Address?

Scientific figures pack complex architectures and workflows into compact visuals, but we usually encounter them as raster images (like PNGs) or AI-generated bitmaps. While raster images preserve how a figure looks, they throw away the object structure needed to edit it.

Existing workarounds fall short on dense scientific diagrams. Traditional vectorization traces contours into low-level paths that don't behave like coherent objects (e.g., an arrow's shaft and head end up as separate, ungrouped pieces). Meanwhile, newer Vision-Language Model (VLM) approaches that generate SVG or drawing code directly often struggle to balance visual fidelity with true element-level editability—especially when thin connectors, overlapping shapes, and nested labels are involved.

Methods

Instead of asking a VLM to write drawing code from scratch, Pixel2Primitives decouples visual perception from geometric construction in three stages:

  1. Localization and Planning: A domain-adapted Segment Anything Model (SAM 3) proposes precise regions for shapes and connectors. Because SAM proposals can be fragmented, a VLM uses full-image context to merge fragments, discard noise, and organize elements into reconstruction tasks (e.g., grouping overlapping shapes or connected arrow trunks). Text, formulas, and embedded image assets are localized via a coarse-to-fine VLM pass.
  2. Category-Specific Reconstruction: For shapes and connectors, the VLM predicts explicit geometric observations—hierarchies of parts, paths, sample points, and occlusion flags—in local image crops. These predictions are rendered as overlays on the crop so a VLM critic can inspect and iteratively refine them (e.g., "shorten last arrow" or "shift left"). Numerical fitting then converts the refined points into native PowerPoint shapes, connectors, and freeform curves. Meanwhile, text becomes editable text boxes, formulas are converted to native Office equations (OMML), and image assets are cleaned of overlapping labels and given transparent backgrounds.
  3. Layered Assembly: All reconstructed elements are mapped back to their original coordinates and assembled into a .pptx file with Z-order (stacking) adjustments so every object remains editable at its intended granularity.
Figure 2. Overview of Pixel2Primitives. (A) A VLM combines SAM proposals with full-image context to plan reconstruction tasks for shapes, connectors, text, and image assets. (B) Shapes and connectors are reconstructed through point sampling, VLM critic feedback, and geometric fitting. Text and formulas become editable text and equations; image assets are restored as transparent layers. (C) Reconstructed elements are mapped to the source coordinates and assembled with Z-order adjustment into an editable PowerPoint slide.

Datasets

  • PDF-to-PPTX Data Engine (98,861 figures): To train SAM on dense scientific diagrams without manual labeling, the authors built an automated pipeline that extracts framework figures from research paper PDFs, parses their vector drawing objects into PowerPoint primitives, and groups fragmented paths (like an arrow's shaft and head) into coherent instances. This yields 98,861 figures and over 9.1 million annotated instances.
  • P2PBench (150 figures): A new, expert-verified benchmark of 150 scientific figures across three difficulty tiers (Easy, Medium, Hard) from 10 conferences. Each figure includes a verified PowerPoint ground truth and semantic annotations to evaluate both Fidelity (semantic and visual correctness) and Editability (structural validity plus executable editing operations).
  • PPTBench (500 tasks): An existing benchmark used alongside P2PBench to evaluate overall slide reconstruction.
Figure 3. Overview of our data engine and benchmark. (A) Framework figures are cropped from papers under critic verification and filtered for native-primitive content. (B) Vector PDFs are reconstructed into native PowerPoint objects and grouped into element instances to fine-tune SAM. (C) P2PBench contains 150 expert-rated figures across three difficulty levels and evaluates Fidelity and Editability on semantic units.

Key Insights and Ideas

  • Decoupling perception from code generation pays off: Having a VLM predict explicit geometric points and letting a visual critic refine them on local crops is far more reliable than asking a VLM to directly output python-pptx or SVG code.
  • Pixel similarity doesn't equal editability: Standard image metrics (like 1-MSE or SSIM) can be inflated by large background regions and completely miss broken topology. For instance, a baseline can score reasonably on visual fidelity while scoring near zero on connection editability.
  • Domain adaptation is critical for thin primitives: Pretrained segmentation models struggle with thin lines and arrowheads. Fine-tuning SAM on grouped vector-PDF primitives accounts for a major jump in connection fidelity (+8.09 points over pretrained SAM).

Key Results

  • P2PBench: Using GPT-5.6 Sol as the backbone, Pixel2Primitives achieves 94.36 Overall Fidelity and 93.40 Overall Editability, outperforming the strongest baselines by 3.32 and 8.64 points, respectively. Using GLM-5.3 Flash, it reaches 92.55 Fidelity and 92.26 Editability.
  • PPTBench: Pixel2Primitives scores 79.64 (GPT-5.6 Sol) and 64.23 (GLM-5.3 Flash), beating AutoFigure-Edit by 8.07 and 29.45 points under the same backbones, and showing much stronger robustness across different models.
  • Qualitative gains: Compared to baselines that suffer from reversed arrows, missing module boxes, or overlapping labels, Pixel2Primitives preserves both clean geometry and native editing structure.
Figure 1. Qualitative comparison on P2PBench using GPT-5.6 Sol (a, b) and GLM-5.3 Flash (c, d). Code agents are Codex (GPT) and ZCode (GLM). Red boxes mark baseline errors.

Limitations and Future Work

  • Iterative geometric refinement requires additional model calls, and very dense, intersecting lines or complex curves remain challenging for VLM perception.
  • The framework currently targets discrete diagrams (shapes, connectors, text, formulas, image assets); data-driven statistical plots and continuous illustrations are left for future work.
  • Because a single figure can have multiple valid PowerPoint reconstructions, evaluating against a single reference involves some inherent subjectivity.

Summary updated

BibTeX
@misc{yin2026pixel,
  author = {Jinhui Yin and Daozhu Dong and Yiqun Kou and Kehan HU and Baoxiang Du and Xu He and Danni Yang and Erfei Cui and Guanzhou Chen and Yuanqi Li and Yanwen Guo and Zhihang Zhong and Lei Yang and Hongjie Zhang and Qi Zhang},
  title = {{Pixel2Primitives: Geometry-Aware Reconstruction of Editable Scientific Figures}},
  year = {2026},
  eprint = {2612.05044},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.05044},
}
Figure