Quantitative image editing
RulerEdit: Quantitative Image Editing via 3D Rulers
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.

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.
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.
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.
| Method | Input | Translation | Resizing | Full image | ||
|---|---|---|---|---|---|---|
| Success ↑ | Error (px) ↓ | Success ↑ | Error (px) ↓ | MSE ↓ / SSIM ↑ | ||
| Qwen-Image-Edit-2511 | 2D line | 0/31 (0%) | -- | 0/19 (0%) | -- | 6.97 / 0.881 |
| Qwen-Image-Edit-2511 | Our 3D cues | 1/31 (3.2%) | 15.15 / 15.15 / 15.15 | 0/19 (0%) | -- | 15.54 / 0.830 |
| Qwen-Image-Edit-2511 | Endpoint text | 0/31 (0%) | -- | 1/19 (5.3%) | 37.77 / 37.77 / 37.77 | 8.76 / 0.839 |
| GPT-Image-2 | 2D line | 6/31 (19.4%) | 17.76 / 15.19 / 25.21 | 13/19 (68.4%) | 16.16 / 15.70 / 26.27 | 4.15 / 0.909 |
| GPT-Image-2 | Our 3D cues | 3/31 (9.7%) | 16.21 / 14.43 / 21.20 | 4/19 (21.1%) | 17.32 / 16.79 / 31.05 | 5.91 / 0.897 |
| GPT-Image-2 | Endpoint text | 16/31 (51.6%) | 20.31 / 19.21 / 29.75 | 10/19 (52.6%) | 18.71 / 14.62 / 40.50 | 3.55 / 0.906 |
| GSI-BAGEL | Numeric text† | 2/31 (6.5%) | 64.40 / 64.40 / 68.47 | 1/19 (5.3%) | 5.68 / 5.68 / 5.68 | 10.52 / 0.894 |
| PhyEdit | Mask + displ. | 11/31 (35.5%) | 7.64 / 7.85 / 10.68 | -- | -- | 2.97 / 0.940 |
| PhyEdit | GT mask† + displ. | 14/31 (45.2%) | 7.73 / 7.05 / 11.77 | -- | -- | 2.71 / 0.942 |
| Thinking in Boxes | 3D box | 21/31 (67.7%) | 6.45 / 6.10 / 12.90 | 1/19 (5.3%) | 12.80 / 12.80 / 12.80 | 6.20 / 0.885 |
| BoxCtrl | 3D box | 25/31 (80.6%) | 5.65 / 3.14 / 14.51 | 14/19 (73.7%) | 5.17 / 3.19 / 12.06 | 7.06 / 0.931 |
| RoPEMover | Mask + displ. | 29/31 (93.5%) | 7.13 / 6.94 / 11.92 | -- | -- | 2.74 / 0.916 |
| RulerEdit | Our 3D cues | 31/31 (100%) | 5.71 / 3.09 / 7.90 | 19/19 (100%) | 4.65 / 2.71 / 10.98 | 0.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.
| Method | Succ. ↑ | eℓ (%) ↓ | eθ (°) ↓ | eEPE (px) ↓ | |||
|---|---|---|---|---|---|---|---|
| Med. | P90 | Med. | P90 | Med. | P90 | ||
| BoxCtrl | 31/105 | 3.83 | 60.19 | 1.70 | 35.34 | 4.97 | 26.97 |
| RoPEMover | 55/91 | 5.93 | 24.53 | 5.15 | 34.23 | 11.92 | 43.73 |
| PhyEdit | 47/91 | 6.13 | 36.73 | 2.81 | 10.65 | 10.74 | 31.89 |
| GPT-Image-2 | 98/105 | 15.51 | 47.94 | 7.57 | 17.26 | 31.00 | 69.27 |
| RulerEdit | 93/105 | 2.41 | 23.07 | 2.45 | 10.89 | 4.05 | 16.96 |
With rulers built by the agent, editing stays accurate end to end, even without the reference ruler.
| Metric | Construction | Editing | |||
|---|---|---|---|---|---|
| w/ | w/o | GT ruler | Agent w/ | Agent w/o | |
| Success ↑ | -- | -- | 93/105 | 93/105 | 87/105 |
| eℓ (%) ↓ | 4.61 / 3.14 / 9.83 | 4.53 / 2.53 / 9.27 | 7.37 / 2.41 / 23.07 | 8.48 / 5.11 / 19.87 | 8.08 / 4.35 / 19.19 |
| eθ (°) ↓ | 3.25 / 1.95 / 8.46 | 3.51 / 2.18 / 8.20 | 4.71 / 2.45 / 10.89 | 4.65 / 2.51 / 10.77 | 5.75 / 3.45 / 12.66 |
| eproj (px) ↓ | 4.42 / 3.14 / 10.39 | 4.81 / 3.32 / 9.59 | 4.97 / 2.71 / 13.46 | 6.98 / 5.20 / 15.05 | 7.54 / 5.64 / 19.08 |
| eEPE (px) ↓ | 5.52 / 4.22 / 11.68 | 6.05 / 4.74 / 12.02 | 6.17 / 4.05 / 16.96 | 8.46 / 6.97 / 17.79 | 9.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.
- 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.
- 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.
- 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.
| Depth | α | Error / bound | Relative error (%) | ||
|---|---|---|---|---|---|
| Med. | Max | Med. | P90 | ||
| DA3 | 0 | 0.63 | 1.00 | 0.77 | 4.13 |
| DA3 | 0.5 | 0.18 | 0.82 | 1.11 | 4.75 |
| DA3 | 1 | 0.15 | 0.74 | 1.60 | 5.77 |
| MoGe-3 | 0 | 0.66 | 1.00 | 2.49 | 12.15 |
| MoGe-3 | 0.5 | 0.19 | 0.81 | 3.31 | 12.57 |
| MoGe-3 | 1 | 0.15 | 0.72 | 4.84 | 13.78 |
| Shifted scene | Swept surface | ||
|---|---|---|---|
| Position (px)↓ | Relative (%)↓ | IoU (%)↑ | Endpoint (px)↓ |
| 2.24 / 15.74 | 1.01 / 5.35 | 94.84 / 86.39 | 3.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}
}