Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

Merge PR #2698: LR-IMP-FORMATS: AHD blends its candidates where noise alone would pick one, no maze in noisy raws (#2094)

aionggacf0f6b938c7
diff --cc crates/raw/src/demosaic/ahd.rs
index 6afcd9251,c4180de4d..9a1d477e8
--- a/crates/raw/src/demosaic/ahd.rs
+++ b/crates/raw/src/demosaic/ahd.rs
@@@ -19,14 -20,14 +20,19 @@@ use rayon::prelude::*
const TILE: usize = 128;
const MARGIN: usize = 6;
+ /// Difference of the two candidates' 3×3 homogeneity sums (each 0–36) from which the more homogeneous one is taken
+ /// alone; closer sums blend the two linearly, equal sums half and half. In a flat, noisy area noise alone decides
+ /// which sum is larger, and picking outright turned the noise into short horizontal and vertical strokes (a maze,
+ /// coloured where white balance is strong). 12 keeps the PSNR of the outright pick on the edge tests.
+ const BLEND: f32 = 12.0;
pub(crate) fn ahd(m: &Mosaic) -> Rgb32f {
- let (w, h) = (m.w, m.h);
+ ahd_window(m, 0, 0, m.w, m.h)
+}
+
+/// The `w × h` pixels at (`x`, `y`) of [`ahd`]'s picture (inside the mosaic), demosaiced alone: every pixel comes
+/// from the mosaic around it, so they are the same as when the whole picture is demosaiced and then cropped.
+pub(crate) fn ahd_window(m: &Mosaic, x: usize, y: usize, w: usize, h: usize) -> Rgb32f {
let mut out = Rgb32f::new(w, h);
if w == 0 || h == 0 {
return out;
diff --cc docs/whats-new.md
index 8e3e93adb,3425741ba..c56e22495
--- a/docs/whats-new.md
+++ b/docs/whats-new.md
@@@ -50,9 -21,13 +50,16 @@@
## 2026-10-23
+### The histogram stays in view
+- The histogram stays at the top of the Edit panel while its sliders scroll under it (issue #2679). It used to scroll
+ away with them, so it was out of sight while using the sliders further down the panel.
+ ### No maze pattern in noisy raws
+ - Flat areas of high-ISO raws, such as a dim wall or a blurred background, could show short horizontal and vertical
+ strokes instead of grain, often orange and blue under warm light. Noise reduction made them stand out more, because
+ it smooths the grain around them. The demosaic chose between a horizontal and a vertical guess at each pixel, and
+ in a flat area the noise alone decided which. Where neither guess is clearly better it now blends the two, so the
+ noise looks like grain. Edges are as sharp as before. Thumbnails and previews that LightCraft rendered from a raw
+ are redrawn; the camera's own embedded preview, shown for an unedited raw until its render is ready, is unchanged.
### Tab leaves the name field in New Album, New Smart Album and the name prompts
- In New Album, New Smart Album, Save Metadata Preset and the other dialogs with one name field, the field has the