mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
main brought the graded erase (#11901), decontamination (#11902) and graded Find Edges (#11904) into bg_erase.rs, and kept Protect Foreground Color on the largest per-channel difference to the foreground. Resolved by narrowing the Tolerance itself: with protection on, graded_weight runs on min(Tolerance, distance from the sample to the foreground); a foreground equal to the sample erases nothing. This replaces the distance stretch from before the merge. Measured in the reference application with the issue's drag, foreground off in two channels: (100,140,40) gives 0 32 75 112 156 196 238 255 (no protection), (150,90,40) the block-5 row, (230,90,40) and (200,90,70) a Tolerance of 50 levels. So the narrowing uses the sample-match distance (largest increase plus largest decrease), not the largest per-channel difference: the test on main that kept the sampled colour for a two-channel foreground is replaced by these rows. The reference rows of #11903 now match within 8 levels, 8- and 16-bit. Co-Authored-By: Claude Opus 5.5 <[email protected]>