nind-denoise can be quite aggressive, especially as there was no skin sample in its training set. As a Fujifilm shooter, I like the X-Trans noise, they look natural and similar to film grain, so I’m blending some of the luma noise back (and also because it’s trendy
)
Refactored the script to be more modern with the help of Gemini (I know AI is discouraged here, but I’m not good with Python). Added a [grain] section in the dt_nind_denoise.ini file.
[grain]
# Optional: Path to .dtstyle template to extract natural grain.
# If commented out or missing, natural grain blending is completely skipped.
style = grain_profile.dtstyle
# Minimum noise standard deviation to trigger blending
noise_thresh = 500.0
# Base alpha for grain blending.
# You can use a fixed number:
# alpha = 0.20
# Or a dynamic formula using the 'noise' variable:
# alpha = 0.20 * (noise / 150)
# You can also cap it using min/max so it doesn't get out of hand on ISO 12800 shots:
# alpha = min(0.60, 0.20 * (noise / 150))
alpha = min(0.50, 0.2 * (noise/ 5000))
To add grain, I applied and tweak the denoise (profiled) - wavelets: chroma only preset to keep only luma noise, export that as a style, then specify the path to that style in the .ini file. The script will parse the .dtstyle file and append the operations to the XMP history stack.
(I used darktable-cli --style at first, but currently darktable requires importing a style first, thus it’d lock the DB from darktable GUI while running the script (or vice versa)
The script will export the RAW file twice, first with nind-denoise, second without nind-denoise but with the style applied, then compare the two outputs to determine the noise level. noise_thresh is the base noise threshold to apply the grain or not. The alpha param is the amount of blending, it can be a value or dynamically calculated based on the detected noise level (ISO is not a good indicator as I capped AutoISO at 800 on my cameras).
Reran some past samples for comparison.
nind-denoise only
with grain blended in (alpha=0.181)
.
nind-denoise only
with grain blended in (alpha=0.139)
.
nind-denoise only
with grain blended in (alpha=0.141)
.
nind-denoise only
with grain blended in (alpha=0.148)
.
nind-denoise only
with grain blended in (alpha=0.174)









