fix(export): apply Contrast Mask and Tilt/Swing in tiled export - #883
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:apply_keystone.and not tiling_mode). Its plane is built from the pre-geometry source, which a tile does not hold.Fix
GeometryProcessor's order.Two neighbours of the same bug, found while checking the rest of the settings:
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.pyrenders tiled against untiled and asserts the picture matches. All five tests fail onmainand 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 allgreen: 4272 passed, 11 skipped.