feat(plustek): add Multi-Pass scanning, refine Multi-Exposure controls - #1064
Draft
TobbyTravel wants to merge 4 commits into
Draft
feat(plustek): add Multi-Pass scanning, refine Multi-Exposure controls#1064TobbyTravel wants to merge 4 commits into
TobbyTravel wants to merge 4 commits into
Conversation
pyopticfilm's Multi-Pass feature (PR marcinz606#65) repeats a single exposure n_passes times and stacks the aligned repeats for an SNR gain, as an axis orthogonal to the existing ME (short+long) fusion rather than an alternative to it. Replaces the earlier N-brackets design this branch was originally built against (never shipped upstream) with a plain "Passes" control (1-9) independent of the Multi-exposure mode combo (Off/Adaptive/Fixed), matching pyopticfilm's actual API: Scanner.scan(multi_exposure, me_exposure_mode, n_passes, align_passes). IR and Multi-Pass cannot combine yet (pyopticfilm rejects it), so the sidebar disables/resets whichever control was set second, and the backend fails fast with a RuntimeError before touching hardware if both reach it anyway. Claude-Session: https://claude.ai/code/session_016bn5DFZyR6BS8ApqhPXUoY
Simplifies the two independent ME-mode/Passes controls into one "Scan mode" combo (Single-Pass, Multi-Pass, Adaptive Multi-Exposure, Adaptive Multi-Pass) with a 2-9 slider that only appears for the two stacking modes. Drops "Fixed" long-exposure mode from NegPy's surface entirely — it's a pyopticfilm lab/debug-only concept now (see Scan Lab, which keeps full unrestricted access to it and the manual exposure overrides). - MultiExposureMode loses FIXED; ScannerSettings' existing unknown-value-degrades-to-off migration path already handles a persisted "fixed" blob safely, no new migration code needed. - New ScanCaptureMode (UI-only, never persisted) with translation helpers to/from the real (multi_exposure_mode, n_passes) fields, keeping the domain model as pyopticfilm's actual orthogonal axes. - Checking IR while a stacking mode is selected drops the mode to its non-stacking equivalent (Multi-Pass -> Single-Pass, Adaptive Multi-Pass -> Adaptive Multi-Exposure) rather than silently resetting a hidden value; selecting a stacking mode while IR is checked unchecks IR. - Per-item capability gating on the mode combo, with graceful fallback (drop just the unavailable axis) if the current selection becomes invalid on a capability change. Claude-Session: https://claude.ai/code/session_016bn5DFZyR6BS8ApqhPXUoY
3 tasks
…ing conflict pyopticfilm dropped its "fixed" ME exposure mode (never exposed in this app's UI) and the me_exposure_mode parameter along with it — remove the now-nonexistent kwarg from the Scanner.scan() call. Also self-heal an IR + Multi-Pass stacking conflict at settings-load time the same way the live toggle handlers already do, instead of only catching it when the user touches a control (a settings blob saved with both set would otherwise reach Scan and fail there). Replace the locally mirrored MAX_PASSES_UI constant with an import of pyopticfilm's own MAX_N_PASSES, and add a test for the n_passes=9 upper boundary. Claude-Session: https://claude.ai/code/session_01KThZJVYa894isy2k8aZXtK
self._caps_max_n_passes was written in three places but never read; every live site already passes caps.max_n_passes straight through. First-time Multi-Pass selection was landing users on the slider floor (2) instead of the intended default (3). Claude-Session: https://claude.ai/code/session_01GTVvLh5UfczCAeTKFHzny6
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.
Summary
Adds Multi-Pass scanning for Plustek GL128 devices (repeat an exposure and stack the results for a noise reduction), and refines the existing Multi-Exposure control alongside it. The two are independent axes that compose, giving four scan modes total:
GUI refinement
Benchmark (8100 V2, 7200dpi, same negative frame)
Benchmark, same negative frame, 8100 V2 @ 7200dpi (per-channel noise std-dev on matched flat crops; R/G/B, and average % noise reduction vs. Single-Pass baseline):
Test plan
pytest tests/scanners/ tests/test_scan_sidebar.py -q— 555 passed, 4 skippedpytest tests/ -q— full suite green (5490 passed, 22 skipped)Draft — awaiting a pyopticfilm release containing PR #65 before this is ready to merge.