diff --git a/src/common/ai/restore_raw_linear.c b/src/common/ai/restore_raw_linear.c index 5d19c5bf40c..a7b121a4cb5 100644 --- a/src/common/ai/restore_raw_linear.c +++ b/src/common/ai/restore_raw_linear.c @@ -1117,7 +1117,7 @@ int dt_restore_raw_linear_preview_piped(dt_restore_context_t *ctx, } const size_t pix = (size_t)sr_raw * raw_w + sc_raw; - if(is_linear) + if(is_linear && mip_channels >= 3) { // float mipmaps are already in [0, 1]; uint16 needs un-prepare for(int c = 0; c < 3; c++) @@ -1136,6 +1136,12 @@ int dt_restore_raw_linear_preview_piped(dt_restore_context_t *ctx, } } } + else if(is_linear) + { + // 4BAYER (CYGM/RGBE) classified as LINEAR but has mip_channels==1. + // no canonical RGB→CYGM/RGBE mapping; leave the original mosaic + // pixel untouched (already in `patched` from the memcpy above) + } else { // X-Trans: re-mosaic diff --git a/src/libs/neural_restore.c b/src/libs/neural_restore.c index 1f622c9cbca..b5ea6950c63 100644 --- a/src/libs/neural_restore.c +++ b/src/libs/neural_restore.c @@ -1366,8 +1366,10 @@ static int _process_raw_denoise_one(dt_neural_job_t *j, // most LINEAR-class inputs are computational raws (Apple // ProRAW, Google HDR+, etc.) that have already been denoised // on-device; the model will run but adds little; Canon/Nikon - // sRAW is the exception; warn once per job and proceed - if(!j->linear_warned) + // sRAW is the exception; warn once per job and proceed. + // 4BAYER (CYGM/RGBE) piggybacks on LINEAR class but isn't a + // computational raw — skip the misleading toast + if(!j->linear_warned && !(flags & DT_IMAGE_4BAYER)) { j->linear_warned = TRUE; dt_control_log(_("raw denoise: this image is already pre-demosaiced " @@ -2720,8 +2722,10 @@ static gpointer _preview_thread_raw(gpointer data) // same caveat as the batch path: LINEAR is usually a computational // raw that's already been denoised on-device. warn once per imgid - // so picking a different patch doesn't re-toast + // so picking a different patch doesn't re-toast. 4BAYER piggybacks + // on LINEAR class but isn't computational — skip the toast for it if(cls == DT_RESTORE_SENSOR_CLASS_LINEAR + && !(img_meta.flags & DT_IMAGE_4BAYER) && d->preview_linear_warned_imgid != pd->imgid) { d->preview_linear_warned_imgid = pd->imgid;