Repository navigation
fix(ir): IR Threshold sets where IR repair starts - #1699
Merged
Merged
Conversation
The IR division (attenuation) acted on every pixel with an IR ratio below a fixed 0.97, and the Marked overlay showed that same fixed mask. IR Threshold moved only the fill cutoff, so on a scan where the image leaves a faint ghost in the IR plane (discussion #1698, Plustek 7600i) the slider seemed to do nothing while bright areas turned gray. IR Threshold now also sets the repair onset (0.97 - 0.15 x slider): the attenuation gain, the top of the fill ramp and the overlay all start there. On 7 Plustek 8100 frames the default touches 3-7% of the frame instead of 8-17%; dust specks stay repaired.
marcinz606
marked this pull request as ready for review
November 18, 2026 18:23
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.
Prototype for discussion #1698.
Problem
IR attenuation divided every pixel with an IR ratio below a fixed 0.97, and the Marked overlay showed that fixed mask. IR Threshold moved only the fill cutoff. On the reporter's Plustek 7600i scan the image leaves a faint ghost in the IR plane, so the bright P sign and the sand turned gray and spotty, and the slider seemed to do nothing.
Change
ir_attenuation_onset(slider) = 0.97 - 0.15 * slider(slider 0.05..0.95 → onset 0.96..0.83, default 0.66 → 0.87).ir_ratio_and_gainsplits intoir_ratio(cached, slider-independent) andir_gain(…, onset)(recomputed on a threshold change, cheap).THUMBNAIL_RENDER_VERSION42 → 43: the default look changes.Evidence
On 7 local Plustek 8100 frames with IR, the area with any IR gain drops from 8–17% of the frame to 3–7% at the default. A headless app run on one frame (IR off / 0.05 / 0.95) renders, removes the sky dust specks at both settings, and changes ~3.7% of pixels between the two settings.
Open questions
_ir_decontaminate(the ghost fit misses dense highlights). Need their TIFF with the IR channel.USER_GUIDE.mdand the tooltip still say "lower finds more", which stays true; no guide or translation change yet.