Skip to content

fix(export): apply Contrast Mask and Tilt/Swing in tiled export - #883

Merged
marcinz606 merged 1 commit into
mainfrom
fix/tiled-export-drops-settings
Aug 17, 2026
Merged

fix(export): apply Contrast Mask and Tilt/Swing in tiled export#883
marcinz606 merged 1 commit into
mainfrom
fix/tiled-export-drops-settings

Conversation

@marcinz606

Copy link
Copy Markdown
Owner

Problem

Contrast Mask and Tilt/Swing worked in the preview and were dropped from exports.

Both live in _process_tiled, the path an export takes once the frame passes the tiling threshold:

  • The CPU geometry replay ran rot90 → flips → fine rotation → distortion and stopped there, with no apply_keystone.
  • The Contrast Mask was gated off in tiling mode (and not tiling_mode). Its plane is built from the pre-geometry source, which a tile does not hold.

Fix

  • Keystone joins the CPU replay, last, in GeometryProcessor's order.
  • The mask plane is built once per export and passed to each tile, which shifts the printed frame into its own coords. All tiles share one plane texture.

Two neighbours of the same bug, found while checking the rest of the settings:

  • The GPU preview rasterised dodge/burn masks without the convergences, so a mask sat on an uncorrected frame whenever Tilt/Swing was up. Its cache key and the UV grid's key did not see them either.
  • Tiled export reused the CLAHE CDF from the last preview render, keyed only on clahe_strength — which could belong to a different image. It now takes the CDF from the meter render it makes of the frame being exported.

Verification

tests/test_gpu_tiled_parity.py renders tiled against untiled and asserts the picture matches. All five tests fail on main and pass here.

A per-field sweep over process / exposure / geometry / lab / toning / finish / altproc (plus B&W mode and the alt processes) shows parity at or below 2e-5 mean for every control. CLAHE stays at ~1e-3: the tiles share the CDF the preview-sized meter render built, which is the preview's own mapping. A cropped frame carries a ~0.1% metering offset from ROI rounding on the analysis downsample, unchanged by this PR.

make all green: 4272 passed, 11 skipped.

…ed export

A tiled full-res export replays geometry on the CPU and skipped the keystone,
so Tilt/Swing never reached an export over the tiling threshold. The Contrast
Mask was gated off in tiling mode outright: the plane is built from the
pre-geometry source, which a tile does not hold, so it is built once per export
and each tile shifts the printed frame into its own coords.

Two neighbours of the same bug:

- The GPU preview rasterised dodge/burn masks without the convergences, so a
  mask sat on an uncorrected frame whenever Tilt/Swing was up, and its cache
  key (and the UV grid's) did not see them either.
- Tiled export reused the CLAHE CDF from the last preview render, keyed only on
  clahe_strength — which could belong to another image. It now takes the CDF
  from the meter render it makes of the frame being exported.

tests/test_gpu_tiled_parity.py renders tiled against untiled and asserts the
picture matches; a per-field sweep over process/exposure/geometry/lab/toning/
finish/altproc leaves CLAHE (preview-resolution CDF, by design) as the only
control with a visible gap.
@marcinz606
marcinz606 merged commit f38f296 into main Aug 17, 2026
1 check passed
@marcinz606
marcinz606 deleted the fix/tiled-export-drops-settings branch August 17, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant