Repair clipped details after sharpen

I went recently in the fenestrelle fortress, Italy.
I’ve took mainly .DNG file photos with the smartphone but I’ve used a slighty different kind of sharpening than my usual.
The main idea is that when local contrast is added to a photo then some details are clipped.
The simple solution is to compare the sharpened version with the original version, if something is clipped we just use the unsharpened pixels, basically it’s like a threshold.

My workflow was to export an unsharpened and one sharpened file from the raw converter, then I’ve used the custom blend layer mode in g’mic where the sharpened file is the top layer and this formula:
“b=if(b==0&&a>0 ,a ,b);if(b==1&&a<1,a,b)” :thinking:

With other low contrast pictures without a true black or white point, I’ve first found the min value and the max value, like this one

I think the effect of this kind of threshold isn’t something that totally change a picture but it could help to gives a more clean and sharpened photo :slight_smile:

hi @age, I like the fortress photo. I hadn’t realised cam photos could be of such quality! Sharp; leaves against the sky ok, etc. What phone was it? (no EXIF)

I’m a bit confused whether you mean sharpening or “true” local contrast. I suppose I don’t think of sharpening (a very very local contrast effect!) as causing clipping problems, whereas true local contrast yes.

1 Like

The first photo was taken with a p9 lite and the second with a canon compact, and yes I was referring to the classic unsharp mask with radius=1

Yes, USM is really an ‘edge contrast’ manipulation, and it definitely can push the pixels to the lighter side of an edge out of display range.

I may be mistaken, but I think all tools that claim to sharpen are really just increasing the contrast at detected edges… ??

@ggbutcher Edges and Microcontrast - RawPedia

1 Like

Yes, mistaken I was. Thanks, @Morgan_Hardwood!

Now, can the RT Edges tool push pixels into clipping? Not at home to try it…

Not that I know of. I would describe the effect as “crystallizing” - pixels are assimilated into larger crystals. It doesn’t rely on changing edge contrast as USM does.

Current rt dev version has a contrast based threshold to control sharpening for USM and RL