Quantitative image editing

RulerEdit: Quantitative Image Editing via 3D Rulers

Jinglin Chen Shiyi Zhang Zetong Zhao Shilin Ma Yansong Tang†

Tsinghua Shenzhen International Graduate School, Tsinghua University

† Corresponding author

TL;DR RulerEdit measures an editing request as a ruler in 3D, then renders it into visual cues that an image editing model follows.

Abstract

Abstract

Current image editing models follow the semantics of instructions but cannot change an object by a user-specified 3D length. We attribute this to a lack of spatial intelligence: 2D editing models learn only on the image plane and cannot measure or follow lengths in 3D. We propose RulerEdit for quantitative image editing. RulerEdit first converts the editing request into a target ruler in 3D space and then renders it into depth-aware visual cues, namely a shifted scene that describes the motion and a swept surface that describes the final shape, which guide the editing model. Since a single image carries no absolute scale, the ruler length is defined relative to a reference ruler in the same image, and a user or an agent constructs the ruler by picking five points on visible surfaces, which are lifted to 3D with monocular depth. Trained only on procedurally generated Blender data, RulerEdit directly edits real photographs. We also introduce RulerBench to evaluate quantitative editing. Compared with other editing models, RulerEdit edits sizes more accurately and achieves clearly lower errors on multiple metrics.

01 / Overview

Measure first, then edit

Image editing models follow instructions such as "move" or "pull out," but once the instruction contains a number, the magnitude of the edit is nearly random. Such a length is a quantity in 3D, whereas editing models learn only on the 2D image plane and lack spatial intelligence. We propose RulerEdit with a measure-then-edit paradigm: it first measures the request as a ruler in 3D and then lets the model follow it.

Real images before and after ruler-guided editing, an agent constructing a ruler, and examples of Blender training data.
Real photographs edited by RulerEdit, with the target ruler drawn on each pair (teal: displacement, yellow: span). Right: a ruler built by the agent. Bottom: the Blender training data.

Contributions

  • We define quantitative image editing and build RulerBench to evaluate the 3D error of edits.
  • We propose RulerEdit, which constructs the editing request as a 3D target ruler and renders it into visual cues, bringing spatial intelligence to 2D image editing models.
  • We show that this spatial intelligence can be learned solely from Blender renderings and generalizes to real photographs.

02 / Method

Five points, one ruler, two visual cues

A single image has no absolute scale, so the ruler length is a ratio to a reference ruler in the scene. A user or an agent picks five points on visible surfaces, and monocular depth lifts them to 3D.

The five-point control

R0R1 is the reference ruler, A and B give the direction, and P is the anchor. The ratio r sets the ruler length, and the anchor fraction α places P along it. No point has to float in mid-air.

Two depth-aware visual cues

The shifted scene moves the whole scene along the ruler and reprojects it, showing where the part should go. The swept surface sweeps the ruler across the scene, showing the extent the part should occupy.

Five-point control and rendered cues for whole-object translation, whole-object resizing, and a drawer.
Translation uses the shifted scene, resizing uses the swept surface, and a drawer uses both.
RulerEdit pipeline: the agent constructs a ruler, the renderer produces two visual cues, and the editing model generates the result; training uses Blender pairs.
The agent constructs the ruler, the renderer turns it into visual cues, and Qwen-Image-Edit-2511 with a LoRA trained on Blender pairs generates the edit.

03 / Ruler construction

An agent that constructs the ruler

Many requests must be measured and calculated before a ruler can be placed. The agent picks points, measures in the predicted geometry, runs Python, and previews the ruler before submitting it; the user can then drag any point to refine it. Step through four example runs below.

    Source ·

    Input parameters

    Output result

    04 / Training data

    Learning from Blender only

    We render 10,156 before-and-after pairs in Blender with random rooms, furniture, materials, lighting and cameras. They cover whole-object translation and resizing and more than twenty mechanisms, such as drawers, telescoping tubes and liquid levels. Trained without any real image, the model directly edits real photographs.

    One pair per edit type, source on the left and target on the right.

    05 / Comparisons

    Comparison with other editing methods

    RulerBench has a synthetic split of 1,305 Blender edits and a capture split of 105 photographs with tape-measured lengths. Each method receives the target ruler in its own control format.

    06 / Results

    Quantitative results

    On 50 synthetic pairs, RulerEdit succeeds on every edit and has the lowest full-image error.

    50 synthetic pairs. Errors (mean / median / P90, px) count successful outputs only. †: from the ground truth; --: no success or unsupported.
    MethodInputTranslationResizingFull image
    Success ↑Error (px) ↓Success ↑Error (px) ↓MSE ↓ / SSIM ↑
    Qwen-Image-Edit-25112D line0/31 (0%)--0/19 (0%)--6.97 / 0.881
    Qwen-Image-Edit-2511Our 3D cues1/31 (3.2%)15.15 / 15.15 / 15.150/19 (0%)--15.54 / 0.830
    Qwen-Image-Edit-2511Endpoint text0/31 (0%)--1/19 (5.3%)37.77 / 37.77 / 37.778.76 / 0.839
    GPT-Image-22D line6/31 (19.4%)17.76 / 15.19 / 25.2113/19 (68.4%)16.16 / 15.70 / 26.274.15 / 0.909
    GPT-Image-2Our 3D cues3/31 (9.7%)16.21 / 14.43 / 21.204/19 (21.1%)17.32 / 16.79 / 31.055.91 / 0.897
    GPT-Image-2Endpoint text16/31 (51.6%)20.31 / 19.21 / 29.7510/19 (52.6%)18.71 / 14.62 / 40.503.55 / 0.906
    GSI-BAGELNumeric text†2/31 (6.5%)64.40 / 64.40 / 68.471/19 (5.3%)5.68 / 5.68 / 5.6810.52 / 0.894
    PhyEditMask + displ.11/31 (35.5%)7.64 / 7.85 / 10.68----2.97 / 0.940
    PhyEditGT mask† + displ.14/31 (45.2%)7.73 / 7.05 / 11.77----2.71 / 0.942
    Thinking in Boxes3D box21/31 (67.7%)6.45 / 6.10 / 12.901/19 (5.3%)12.80 / 12.80 / 12.806.20 / 0.885
    BoxCtrl3D box25/31 (80.6%)5.65 / 3.14 / 14.5114/19 (73.7%)5.17 / 3.19 / 12.067.06 / 0.931
    RoPEMoverMask + displ.29/31 (93.5%)7.13 / 6.94 / 11.92----2.74 / 0.916
    RulerEditOur 3D cues31/31 (100%)5.71 / 3.09 / 7.9019/19 (100%)4.65 / 2.71 / 10.980.64 / 0.963

    On captured photographs, RulerEdit has the lowest length and endpoint errors; GPT-Image-2 succeeds slightly more often but ignores the specified size.

    Capture split, all methods given the ground-truth ruler (median / P90). RoPEMover and PhyEdit support 91 of the 105 pairs.
    MethodSucc. ↑eℓ (%) ↓eθ (°) ↓eEPE (px) ↓
    Med.P90Med.P90Med.P90
    BoxCtrl31/1053.8360.191.7035.344.9726.97
    RoPEMover55/915.9324.535.1534.2311.9243.73
    PhyEdit47/916.1336.732.8110.6510.7431.89
    GPT-Image-298/10515.5147.947.5717.2631.0069.27
    RulerEdit93/1052.4123.072.4510.894.0516.96

    With rulers built by the agent, editing stays accurate end to end, even without the reference ruler.

    Capture split (mean / median / P90). w/ and w/o: the agent is or is not given the reference ruler and the ratio.
    MetricConstructionEditing
    w/w/oGT rulerAgent w/Agent w/o
    Success ↑----93/10593/10587/105
    eℓ (%) ↓4.61 / 3.14 / 9.834.53 / 2.53 / 9.277.37 / 2.41 / 23.078.48 / 5.11 / 19.878.08 / 4.35 / 19.19
    eθ (°) ↓3.25 / 1.95 / 8.463.51 / 2.18 / 8.204.71 / 2.45 / 10.894.65 / 2.51 / 10.775.75 / 3.45 / 12.66
    eproj (px) ↓4.42 / 3.14 / 10.394.81 / 3.32 / 9.594.97 / 2.71 / 13.466.98 / 5.20 / 15.057.54 / 5.64 / 19.08
    eEPE (px) ↓5.52 / 4.22 / 11.686.05 / 4.74 / 12.026.17 / 4.05 / 16.968.46 / 6.97 / 17.799.04 / 6.67 / 20.73

    07 / Geometry

    Why relative rulers work

    Monocular depth has no absolute scale, but length ratios survive a similarity transformation. The ruler uses only ratios and directions, so it represents the intended edit anyway.

    1. Distance-ratio consistency. For a point set that is not collinear, the predicted and true geometries agree on all length ratios if and only if they differ by a similarity transformation.
    2. Equivariance. Under that transformation, the ruler endpoints, the shifted scene points and the swept surface transform together, so the rendered cues are the same images.
    3. Stability. If each control point is off by at most η, the endpoint error is at most (1 + 2αr + 4αL/dAB)η, so A and B should be far apart.
    Direction error decreases with A–B spacing for both DA3 and MoGe-3.
    Direction error falls as A and B move apart (solid: median; dashed: P90).
    The stability bound at T0: a maximum error / bound of at most 1 means it always holds.
    DepthαError / boundRelative error (%)
    Med.MaxMed.P90
    DA300.631.000.774.13
    DA30.50.180.821.114.75
    DA310.150.741.605.77
    MoGe-300.661.002.4912.15
    MoGe-30.50.190.813.3112.57
    MoGe-310.150.724.8413.78
    Cues rendered from predicted (DA3) versus true geometry (median / P90; IoU: median / P10).
    Shifted sceneSwept surface
    Position (px)↓Relative (%)↓IoU (%)↑Endpoint (px)↓
    2.24 / 15.741.01 / 5.3594.84 / 86.393.74 / 20.17

    Citation

    BibTeX

    @misc{chen2026ruleredit,
      title         = {{RulerEdit}: Quantitative Image Editing via {3D} Rulers},
      author        = {Chen, Jinglin and Zhang, Shiyi and Zhao, Zetong and Ma, Shilin and Tang, Yansong},
      year          = {2026},
      eprint        = {2612.06292},
      archivePrefix = {arXiv},
      primaryClass  = {cs.CV},
      url           = {https://arxiv.org/abs/2612.06292}
    }