Skip to content

fix(ir): IR Threshold sets where IR repair starts - #1699

Merged
marcinz606 merged 2 commits into
mainfrom
fix/ir-threshold-drives-attenuation
Nov 18, 2026
Merged

marcinz606 merged 2 commits into
mainfrom
fix/ir-threshold-drives-attenuation

Conversation

@marcinz606

Copy link
Copy Markdown
Owner

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).
  • The onset drives the attenuation gain, the top of the fill score ramp and the Marked overlay, in preview and export.
  • ir_ratio_and_gain splits into ir_ratio (cached, slider-independent) and ir_gain(…, onset) (recomputed on a threshold change, cheap).
  • THUMBNAIL_RENDER_VERSION 42 → 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

  • Not tested on the reporter's scan. If their ghost dips deeper than 0.83, no slider setting reaches it, and the fix belongs in _ir_decontaminate (the ghost fit misses dense highlights). Need their TIFF with the IR channel.
  • A raised onset leaves some faint dust uncorrected (visible-gain pixels 1.25% → 1.0% on frame 009 at the default).
  • USER_GUIDE.md and the tooltip still say "lower finds more", which stays true; no guide or translation change yet.

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.
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Preview load metrics (github-linux-x64)

format cold load throughput
CR2 0.737 s 30.43 MPx/s
NEF 0.533 s 46.09 MPx/s
ARW 0.214 s 94.27 MPx/s
RAF 2.183 s 7.45 MPx/s
DNG 0.620 s 38.61 MPx/s

fixtures: rawsamples.ch · sha: d33ef7f · full JSON

@marcinz606
marcinz606 marked this pull request as ready for review November 18, 2026 18:23
@marcinz606
marcinz606 merged commit c111bcb into main Nov 18, 2026
6 checks passed
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