Repository navigation
Lend a small export its RAW's detail above the photograph's samples - #3
Merged
Merged
Conversation
When a photograph is enlarged to the delivery width and a RAW with the same stem sits beside it or in a --raw folder, the RAW adds detail above what the photograph samples. The photograph stays the authority on the look: it is enlarged whole, the RAW is mapped onto its colour with a cubic, and only the RAW's band above the photograph's Nyquist is added, scaled per 64px tile by how well the RAW's next octave down agrees with the photograph's, and held inside the photograph's local range. A RAW is refused when its capture time, frame shape or fine structure disagrees with the photograph's. A full-size camera file never decodes its RAW, so its output is byte-identical. --no-raw turns the search off; the MCP server takes raw and raw_dirs, kept under --root. Measured 2026-11-01 on five X-T50 frames exported at 2048 and rebuilt at 3072, scored against each HIF's own 3072 output with fast-ssim2 0.9.0 and butteraugli 0.9.3 (SSIMULACRA2 / Butteraugli max norm): Nostalgic Neg 74.9/4.33 -> 77.6/3.15 and 76.1/2.64 -> 76.4/2.55, Classic Chrome 83.5/3.17 -> 83.5/2.36, Provia 66.7/4.34 -> 75.9/4.82, and Eterna 80.6/3.47 -> 79.5/4.34, where the RAW engine renders glitter as different sparkles.
CI's stable toolchain moved to 1.99, whose new lint rejects chunks_exact with a constant size. as_chunks has been stable since 1.88, under the crate's rust-version of 1.93. simulate.rs on main trips the same lint.
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.
When a photograph has to be enlarged to the delivery width and a RAW with the same stem sits beside it (or in a
--rawfolder), ig-prep now borrows the RAW's detail above what the photograph samples. A full-size camera file never decodes its RAW, so its output is byte-identical tomain.How the merge works
The photograph stays the authority on the look:
mapped - LP(mapped), whereLPgoes down to the photograph's size and back up.ig-prep refuses a RAW whose capture time, frame shape (0.3% slack) or high-pass structure (NCC under 0.5) disagrees with the photograph's.
--no-rawturns the search off. The MCP server takesrawandraw_dirs, both kept under--root.Measured
Five X-T50 frames, exported at 2048 and rebuilt at 3072, were scored against each HIF's own 3072 output. Scores are SSIMULACRA2 / Butteraugli max norm, from fast-ssim2 0.9.0 and butteraugli 0.9.3. The run was on 2026-11-01.
Known limit: Eterna still loses on both metrics. The RAW engine renders glitter as different sparkles than the camera does, and the tile gain only partly holds them back. Provia's Butteraugli also rises (4.34 to 4.82) while SSIMULACRA2 gains 9.2. A merged 2048 export takes 9.8s.
Checks
cargo test --release --locked: 77 passed. 8 of them are new, insrc/raw.rs. One adds white noise to the RAW and asserts the merge moves the output under a fifth of the RAW's own distance: 3.62 levels against 24.87. With the gate removed it moves 12.59 and fails.cargo fmt --checkandcargo clippy --all-targets -- -D warnings: clean.