Repository navigation
LR-EDIT-LIGHT-HIGHLIGHTS: partly clipped highlights take the colour of bright neighbours; previews clip before averaging (#548) - #602
Conversation
|
@radialmonster heads-up: #602 and my #607 both rework partly clipped reconstruction in
#586 is complementary: it's about recognising clipping, and #607 would sit on top of it fine. Proposal: I run #602 against #607's tests and cases, you run #607 on your iPhone 15 Pro Max file and the Huawei DNGs, and then we fold the two into one PR on top of #586, whichever base you prefer, so the maintainers review a single reconstruction change. Does that work for you? |
|
Thank you @radialmonster! The binned mask fixing the green speckles of #548 is a real improvement. #657 landed #607 (AlexChambers), which rewrites Please join our Discord if you haven't already: https://discord.gg/artcraft |
|
@AlexChambers thanks, and agreed that one reconstruction change is better than two. Since #607 has landed, I'll do it the way echelon asked: rebase #602 onto main and keep only what #607 doesn't cover, which is the binned mask for the coarse-bin green speckles plus a masked variant of the new |
…before averaging (storytold#548) Rework of storytold#602 on top of storytold#607's highlight reconstruction, keeping only what storytold#607 doesn't cover. Small previews and thumbnails bin the mosaic (8 x 8 at 500 px); a colour with one clipped sample in its block used to take the block's maximum, so a specular point turned the block's green to the clip level and reconstruction kept it: green speckles. - raw: RawImage::develop_binned_masked keeps every channel its block mean and returns a mask of the colours that had a clipped sample (develop_binned and the camera-look proxy keep the maximum rule). - highlight: reconstruct_masked is storytold#607's reconstruct_with with the clipped channels taken from the mask (sources, rim, rebuild and fade unchanged); a masked mean is a lower bound, and a fully masked block becomes the clipped white at its own brightest channel rather than lifted to the clip level. A mask built from the values reproduces reconstruct_with exactly (test). - engine: previews/thumbnails (and their denoised twin) use the mask. RENDER_CACHE_VERSION 42 (main + 5; adjust at merge).
ec39ca1 to
7c9feb5
Compare
|
@echelon @AlexChambers rebased onto main and reduced to what #607 doesn't cover: Re-measured on the CC0 Huawei DNGs at 500 px: green speckles 4032 → 311 (WAS-LX1A) and 1299 → 5 (PRA-LX1), with bright-area chroma down from 28–33 to 11–18. Exports and 1:1 views are byte-identical to main. The #548 iPhone DNG has a gain map and is never binned, so #607 alone covers it. Details and crops are in the updated description. |
|
Thank you @radialmonster! The #548 fix landed in #692, from the maintainer merge on this branch (ec39ca1). It keeps #607's reconstruction as the core and adds your binned mask (clipping decided before averaging) with Please join our Discord if you haven't already: https://discord.gg/artcraft |
# Conflicts: # crates/engine/src/media.rs
LR-EDIT-DETAIL-DENOISE: AI Denoise follows Auto Sync, starts at import, one batch row (upstream storytold#2932)
…ow and recipe formats everywhere The model set-up flow went with the built-in denoiser (fork storytold#599), but its messages stayed in some catalogs, and fork storytold#602 / storytold#594 added format messages to some catalogs only: every_catalog_carries_every_message failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
i18n: every catalog carries every message again (after fork storytold#602)
Binned previews and thumbnails now decide clipping per sensor sample before averaging. On coarse bins, that removes the green speckles and colour noise in clipped areas reported in #548. Rebased onto #607, which rewrote
highlight::reconstruct, and reduced, as asked in review, to what #607 doesn't cover.Change
develop_binned_masked: when the raw is binned for a preview or thumbnail, each colour keeps its block mean together with a mask of which colours had a clipped sample. Previously, averaging first let a few clipped samples hide in the mean, and the reconstruction couldn't see them.reconstruct_masked: main'sreconstruct_with(LR-EDIT-LIGHT-HIGHLIGHTS: clipped highlights stay neutral when darkened (#523) #607) now takes the "which channels are clipped" check as a parameter. The plain path passes main's own value test, so LR-EDIT-LIGHT-HIGHLIGHTS: clipped highlights stay neutral when darkened (#523) #607's logic runs unchanged: dark-detail weighting, the demosaic ring, desaturation as more channels clip, and neutral cores. A test proves that a mask built from the values gives byte-identical output toreconstruct_with.This is decoder-side: it changes the camera RGB that comes out of binning and reconstruction, before any settings apply. It also fixes broken output, so under
docs/process-versions.mdit isn't gated on a process. Exports and 1:1 views don't bin and are byte-identical to main.Measurements
CC0 Huawei DNGs from raw.pixls.us. A speckle is a bright pixel whose green exceeds red, blue and its 3 × 3 median by more than 8 levels. C* is the mean chroma in the bright areas of main's render.
The 500 px renders also move closer to a downscaled 1000 px render: the bright-area difference goes 11.7 → 8.9 on WAS-LX1A and 21.9 → 12.0 on PRA-LX1 at −100. The 1000 px renders are identical between main and this PR. The #548 iPhone 15 Pro Max DNG has a GainMap in OpcodeList3, so it's never binned. It's byte-identical here, and its cloud tint is fixed by #607.
Left: main 5436951. Right: this PR. Default settings, 500 px.
Tests
clipping_is_decided_before_averaging,coarse_binning_keeps_specular_points_neutralanda_mask_marks_the_clipped_channels, plus the mask-equivalence test.-D warningsand xtask parity, layers and assets are clean.--no-fail-fast): the only failures also fail on main on Windows: the 7tests_syncpath-separator tests (Synchronize Folder tests: expected paths spelled as the OS does (Windows) #660) and the MCPexport_progress_and_canceltiming test (Flaky test: mcp e2e export_progress_and_cancel finishes before its cancel arrives (parallel export lanes + 100 ms progress throttle) #674).RENDER_CACHE_VERSIONis 42 (main is 37, and our other open PRs use 38–41 and 43), so adjust it at merge.Part of #548.