Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.94k stars 328 forks source link

Capture Sharpening causes black halos #5645

Open teplit opened 4 years ago

teplit commented 4 years ago

A screenshot without any sharpening: RawTherapee - without sharpening

A screenshot with RL Deconvolution sharpening only: RawTherapee - with RL Deconvolution sharpening

A screenshot with automatic Capture Sharpening only: RawTherapee - with automatic Capture Sharpening

The RAW file is located here: https://cdn.hasselblad.com/samples/x1d-II-50c/x1d-II-sample-09.3FR The content of the PP3 file:

[Version]
AppVersion=5.8
Version=346

[General]
Rank=0
ColorLabel=0
InTrash=false

[Exposure]
Auto=false
Clip=0.02
Compensation=1.25
Brightness=0
Contrast=0
Saturation=0
Black=0
HighlightCompr=159
HighlightComprThreshold=0
ShadowCompr=50
HistogramMatching=false
CurveFromHistogramMatching=false
ClampOOG=true
CurveMode=FilmLike
CurveMode2=Perceptual
Curve=3;0.081550218340611408;0;0.10043668122270741;0;1;1;
Curve2=4;0;0;0.67903930131004409;0.9039301310043667;1;1;

[HLRecovery]
Enabled=true
Method=Color

[Retinex]
Enabled=false
Str=20
Scal=3
Iter=1
Grad=1
Grads=1
Gam=1.3
Slope=3
Median=false
Neigh=80
Offs=0
Vart=200
Limd=8
highl=4
skal=3
RetinexMethod=high
mapMethod=none
viewMethod=none
Retinexcolorspace=Lab
Gammaretinex=none
CDCurve=0;
MAPCurve=0;
CDHCurve=0;
LHCurve=0;
Highlights=0
HighlightTonalWidth=80
Shadows=0
ShadowTonalWidth=80
Radius=40
TransmissionCurve=1;0;0.5;0.34999999999999998;0.34999999999999998;0.59999999999999998;0.75;0.34999999999999998;0.34999999999999998;1;0.5;0.34999999999999998;0.34999999999999998;
GainTransmissionCurve=1;0;0.10000000000000001;0.34999999999999998;0;0.25;0.25;0.34999999999999998;0.34999999999999998;0.69999999999999996;0.25;0.34999999999999998;0.34999999999999998;1;0.10000000000000001;0;0;

[Local Contrast]
Enabled=false
Radius=80
Amount=0.20000000000000001
Darkness=1
Lightness=1

[Channel Mixer]
Enabled=false
Red=1000;0;0;
Green=0;1000;0;
Blue=0;0;1000;

[Black & White]
Enabled=false
Method=Desaturation
Auto=false
ComplementaryColors=true
Setting=RGB-Rel
Filter=None
MixerRed=33
MixerOrange=33
MixerYellow=33
MixerGreen=33
MixerCyan=33
MixerBlue=33
MixerMagenta=33
MixerPurple=33
GammaRed=0
GammaGreen=0
GammaBlue=0
Algorithm=SP
LuminanceCurve=0;
BeforeCurveMode=Standard
AfterCurveMode=Standard
BeforeCurve=0;
AfterCurve=0;

[Luminance Curve]
Enabled=true
Brightness=0
Contrast=0
Chromaticity=50
AvoidColorShift=false
RedAndSkinTonesProtection=0
LCredsk=true
LCurve=0;
aCurve=0;
bCurve=0;
ccCurve=0;
chCurve=0;
lhCurve=0;
hhCurve=0;
LcCurve=0;
ClCurve=0;

[Sharpening]
Enabled=true
Contrast=20
Method=rld
Radius=0.5
BlurRadius=0.20000000000000001
Amount=200
Threshold=20;80;2000;1200;
OnlyEdges=false
EdgedetectionRadius=1.8999999999999999
EdgeTolerance=1800
HalocontrolEnabled=false
HalocontrolAmount=85
DeconvRadius=0.69999999999999996
DeconvAmount=50
DeconvDamping=0
DeconvIterations=100

[Vibrance]
Enabled=false
Pastels=0
Saturated=0
PSThreshold=0;75;
ProtectSkins=false
AvoidColorShift=true
PastSatTog=true
SkinTonesCurve=0;

[SharpenEdge]
Enabled=false
Passes=2
Strength=50
ThreeChannels=false

[SharpenMicro]
Enabled=false
Matrix=false
Strength=20
Contrast=20
Uniformity=5

[White Balance]
Enabled=true
Setting=Camera
Temperature=3867
Green=0.92348602273537661
Equal=1
TemperatureBias=0

[Color appearance]
Enabled=false
Degree=90
AutoDegree=true
Degreeout=90
AutoDegreeout=true
Surround=Average
Surrsrc=Average
AdaptLum=16
Badpixsl=0
Model=RawT
Algorithm=JC
J-Light=0
Q-Bright=0
C-Chroma=0
S-Chroma=0
M-Chroma=0
J-Contrast=0
Q-Contrast=0
H-Hue=0
RSTProtection=0
AdaptScene=2000
AutoAdapscen=true
YbScene=18
Autoybscen=true
SurrSource=false
Gamut=true
Tempout=5000
Greenout=1
Tempsc=5000
Greensc=1
Ybout=18
Datacie=false
Tonecie=false
CurveMode=Lightness
CurveMode2=Lightness
CurveMode3=Chroma
Curve=0;
Curve2=0;
Curve3=0;

[Impulse Denoising]
Enabled=false
Threshold=50

[Defringing]
Enabled=false
Radius=2
Threshold=13
HueCurve=1;0.16666666699999999;0;0.34999999999999998;0.34999999999999998;0.34699999999999998;0;0.34999999999999998;0.34999999999999998;0.51366742600000004;0;0.34999999999999998;0.34999999999999998;0.66894457100000004;0;0.34999999999999998;0.34999999999999998;0.82877752459999998;0.97835991;0.34999999999999998;0.34999999999999998;0.99088838270000001;0;0.34999999999999998;0.34999999999999998;

[Dehaze]
Enabled=false
Strength=50
ShowDepthMap=false
Depth=25
Luminance=false

[Directional Pyramid Denoising]
Enabled=false
Enhance=false
Median=false
Luma=0
Ldetail=0
Chroma=15
Method=Lab
LMethod=SLI
CMethod=MAN
C2Method=AUTO
SMethod=shal
MedMethod=soft
RGBMethod=soft
MethodMed=Lonly
Redchro=0
Bluechro=0
Gamma=1.7
Passes=1
LCurve=1;0.050000000000000003;0.14999999999999999;0.34999999999999998;0.34999999999999998;0.55000000000000004;0.040000000000000001;0.34999999999999998;0.34999999999999998;
CCCurve=1;0.050000000000000003;0.5;0.34999999999999998;0.34999999999999998;0.34999999999999998;0.050000000000000003;0.34999999999999998;0.34999999999999998;

[EPD]
Enabled=false
Strength=0.5
Gamma=1
EdgeStopping=1.3999999999999999
Scale=1
ReweightingIterates=0

[FattalToneMapping]
Enabled=false
Threshold=30
Amount=20
Anchor=50

[Shadows & Highlights]
Enabled=false
Highlights=0
HighlightTonalWidth=70
Shadows=0
ShadowTonalWidth=30
Radius=40
Lab=false

[Crop]
Enabled=false
X=0
Y=0
W=8272
H=6200
FixedRatio=true
Ratio=As Image
Orientation=As Image
Guide=Frame

[Coarse Transformation]
Rotate=0
HorizontalFlip=false
VerticalFlip=false

[Common Properties for Transformations]
Method=lin
AutoFill=true

[Rotation]
Degree=0

[Distortion]
Amount=0

[LensProfile]
LcMode=none
LCPFile=
UseDistortion=true
UseVignette=true
UseCA=false
LFCameraMake=
LFCameraModel=
LFLens=

[Perspective]
Horizontal=0
Vertical=0

[Gradient]
Enabled=false
Degree=0
Feather=25
Strength=0.59999999999999998
CenterX=0
CenterY=0

[PCVignette]
Enabled=false
Strength=0.59999999999999998
Feather=50
Roundness=50

[CACorrection]
Red=0
Blue=0

[Vignetting Correction]
Amount=0
Radius=50
Strength=1
CenterX=0
CenterY=0

[Resize]
Enabled=false
Scale=0.11
AppliesTo=Cropped area
Method=Lanczos
DataSpecified=3
Width=900
Height=900
AllowUpscaling=false

[PostDemosaicSharpening]
Enabled=false
Contrast=10
AutoContrast=true
AutoRadius=true
DeconvRadius=0.75
DeconvRadiusOffset=0
DeconvIterCheck=true
DeconvIterations=20

[PostResizeSharpening]
Enabled=false
Contrast=15
Method=rld
Radius=0.5
Amount=200
Threshold=20;80;2000;1200;
OnlyEdges=false
EdgedetectionRadius=1.8999999999999999
EdgeTolerance=1800
HalocontrolEnabled=false
HalocontrolAmount=85
DeconvRadius=0.45000000000000001
DeconvAmount=100
DeconvDamping=0
DeconvIterations=100

[Color Management]
InputProfile=(camera)
ToneCurve=false
ApplyLookTable=false
ApplyBaselineExposureOffset=true
ApplyHueSatMap=true
DCPIlluminant=0
WorkingProfile=ProPhoto
WorkingTRC=none
WorkingTRCGamma=2.3999999999999999
WorkingTRCSlope=12.92
OutputProfile=ProPhoto
OutputProfileIntent=Relative
OutputBPC=true

[Wavelet]
Enabled=false
Strength=100
Balance=0
Iter=0
MaxLev=7
TilesMethod=full
DaubMethod=4_
ChoiceLevMethod=all
BackMethod=grey
LevMethod=4
DirMethod=all
CBgreenhigh=0
CBgreenmed=0
CBgreenlow=0
CBbluehigh=0
CBbluemed=0
CBbluelow=0
Expcontrast=false
Expchroma=false
Expedge=false
Expresid=false
Expfinal=false
Exptoning=false
Expnoise=false
Contrast1=0
Contrast2=0
Contrast3=0
Contrast4=0
Contrast5=0
Contrast6=0
Contrast7=0
Contrast8=0
Contrast9=0
Chroma1=0
Chroma2=0
Chroma3=0
Chroma4=0
Chroma5=0
Chroma6=0
Chroma7=0
Chroma8=0
Chroma9=0
ContExtra=0
HSMethod=with
HLRange=50;75;100;98;
SHRange=0;2;50;25;
Edgcont=0;10;75;40;
Level0noise=0;0;
Level1noise=0;0;
Level2noise=0;0;
Level3noise=0;0;
ThresholdHighlight=5
ThresholdShadow=4
Edgedetect=90
Edgedetectthr=20
EdgedetectthrHi=0
Edgesensi=60
Edgeampli=10
ThresholdChroma=5
CHromaMethod=without
Medgreinf=less
CHSLromaMethod=SL
EDMethod=CU
NPMethod=none
BAMethod=none
TMMethod=cont
ChromaLink=0
ContrastCurve=1;0;0.25;0.34999999999999998;0.34999999999999998;0.5;0.75;0.34999999999999998;0.34999999999999998;0.90000000000000002;0;0.34999999999999998;0.34999999999999998;
Pastlev=0;2;30;20;
Satlev=30;45;130;100;
OpacityCurveRG=1;0;0.5;0.34999999999999998;0.34999999999999998;1;0.5;0.34999999999999998;0.34999999999999998;
OpacityCurveBY=1;0;0.5;0.34999999999999998;0.34999999999999998;1;0.5;0.34999999999999998;0.34999999999999998;
OpacityCurveW=1;0;0.34999999999999998;0.34999999999999998;0;0.34999999999999998;0.75;0.34999999999999998;0.34999999999999998;0.59999999999999998;0.75;0.34999999999999998;0.34999999999999998;1;0.34999999999999998;0;0;
OpacityCurveWL=1;0;0.5;0.34999999999999998;0.34999999999999998;1;0.5;0.34999999999999998;0.34999999999999998;
HHcurve=0;
CHcurve=0;
WavclCurve=0;
Median=false
Medianlev=false
Linkedg=true
CBenab=false
Lipst=false
Skinprotect=0
Hueskin=-5;25;170;120;
Edgrad=15
Edgval=0
ThrEdg=10
AvoidColorShift=false
TMr=false
ResidualcontShadow=0
ResidualcontHighlight=0
ThresholdResidShadow=35
ThresholdResidHighLight=65
Residualchroma=0
ResidualTM=0
Residualgamma=1
HueRangeResidual=0
HueRange=-260;-250;-130;-140;
Contrast=0

[Directional Pyramid Equalizer]
Enabled=false
Gamutlab=false
cbdlMethod=bef
Mult0=1
Mult1=1
Mult2=1
Mult3=1
Mult4=1
Mult5=1
Threshold=0.20000000000000001
Skinprotect=0
Hueskin=-5;25;170;120;

[HSV Equalizer]
Enabled=false
HCurve=0;
SCurve=0;
VCurve=0;

[SoftLight]
Enabled=false
Strength=30

[Film Simulation]
Enabled=false
ClutFilename=
Strength=100

[RGB Curves]
Enabled=false
LumaMode=false
rCurve=0;
gCurve=0;
bCurve=0;

[ColorToning]
Enabled=false
Method=LabRegions
Lumamode=true
Twocolor=Std
Redlow=0
Greenlow=0
Bluelow=0
Satlow=0
Balance=0
Sathigh=0
Redmed=0
Greenmed=0
Bluemed=0
Redhigh=0
Greenhigh=0
Bluehigh=0
Autosat=true
OpacityCurve=1;0;0.29999999999999999;0.34999999999999998;0;0.25;0.80000000000000004;0.34999999999999998;0.34999999999999998;0.69999999999999996;0.80000000000000004;0.34999999999999998;0.34999999999999998;1;0.29999999999999999;0;0;
ColorCurve=1;0.050000000000000003;0.62;0.25;0.25;0.58499999999999996;0.11;0.25;0.25;
SatProtectionThreshold=30
SaturatedOpacity=80
Strength=50
HighlightsColorSaturation=60;80;
ShadowsColorSaturation=80;208;
ClCurve=3;0;0;0.34999999999999998;0.65000000000000002;1;1;
Cl2Curve=3;0;0;0.34999999999999998;0.65000000000000002;1;1;
LabGridALow=0
LabGridBLow=0
LabGridAHigh=0
LabGridBHigh=0
LabRegionA_1=0
LabRegionB_1=0
LabRegionSaturation_1=0
LabRegionSlope_1=1
LabRegionOffset_1=0
LabRegionPower_1=1
LabRegionHueMask_1=1;0.16666666699999999;1;0.34999999999999998;0.34999999999999998;0.82877752459999998;1;0.34999999999999998;0.34999999999999998;
LabRegionChromaticityMask_1=1;0;1;0.34999999999999998;0.34999999999999998;1;1;0.34999999999999998;0.34999999999999998;
LabRegionLightnessMask_1=1;0;1;0.34999999999999998;0.34999999999999998;1;1;0.34999999999999998;0.34999999999999998;
LabRegionMaskBlur_1=0
LabRegionChannel_1=-1
LabRegionsShowMask=-1

[RAW]
DarkFrame=/szeva
DarkFrameAuto=false
FlatFieldFile=
FlatFieldAutoSelect=false
FlatFieldBlurRadius=32
FlatFieldBlurType=Area Flatfield
FlatFieldAutoClipControl=false
FlatFieldClipControl=0
CA=true
CAAvoidColourshift=true
CAAutoIterations=2
CARed=0
CABlue=0
HotPixelFilter=false
DeadPixelFilter=false
HotDeadPixelThresh=100
PreExposure=1

[RAW Bayer]
Method=amaze
Border=4
ImageNum=1
CcSteps=0
PreBlack0=0
PreBlack1=0
PreBlack2=0
PreBlack3=0
PreTwoGreen=true
LineDenoise=0
LineDenoiseDirection=3
GreenEqThreshold=0
DCBIterations=2
DCBEnhance=true
LMMSEIterations=2
DualDemosaicAutoContrast=true
DualDemosaicContrast=20
PixelShiftMotionCorrectionMethod=1
PixelShiftEperIso=0
PixelShiftSigma=1
PixelShiftShowMotion=false
PixelShiftShowMotionMaskOnly=false
pixelShiftHoleFill=true
pixelShiftMedian=false
pixelShiftGreen=true
pixelShiftBlur=true
pixelShiftSmoothFactor=0.69999999999999996
pixelShiftEqualBright=false
pixelShiftEqualBrightChannel=false
pixelShiftNonGreenCross=true
pixelShiftDemosaicMethod=amaze
PDAFLinesFilter=false

[RAW X-Trans]
Method=3-pass (best)
DualDemosaicAutoContrast=true
DualDemosaicContrast=20
Border=7
CcSteps=0
PreBlackRed=0
PreBlackGreen=0
PreBlackBlue=0

[MetaData]
Mode=0

[Film Negative]
Enabled=false
RedRatio=1.3600000000000001
GreenExponent=1.5
BlueRatio=0.85999999999999999

I don't see a practical reason to use the new Capture Sharpening tool.

heckflosse commented 4 years ago

Well, for a better comparison you should set the amount in RL to 100. Your setting of 50 simply blends the unsharpened with the sharpened one at 50% which obviously gives a less sharp image while suppressing the halos in RL.

Left is Capture sharpening, right your RL settings but amount at 100 to show the plain RL grafik

grafik

grafik

RL in detail tab has a lot of bright halos.

Maybe I should add an amount slider to allow blending unsharpened with capture sharpened the same way as RL in detail tab does ;-)

another one, same crop as last one but this time right with RL amount in details tab set to 50 as in your settings. Still bright (or white) halos grafik

teplit commented 4 years ago

For even better technical comparison between Sharpening – RL Deconvolution and Capture Sharpening all relevant settings of both tools need to be equal. In addition to that for fair comparison the style for RAW development needs to be the same – a darker image emphasizes white halos.

So here is an image with Sharpening – RL Deconvolution only: RawTherapee 2 - RL deconvolution

And here is such with Capture Sharpening only: RawTherapee 2 - Capture Sharpening

As a whole the last image looks uglier to me.

heckflosse commented 4 years ago

There is a reason, auto limit iterations is enabled by default in Capture Sharpening. I would never use 100 iterations and I always use the auto limit iterations enabled except for this kind of technical comparisons.

Btw: in my example screenshots above I did not use 100 (I used 30) iterations for RL in details tab and the bright halos were still present

heckflosse commented 4 years ago

Here's another comparison. Middle is unsharpened. Which one has more halos, right or left? grafik

teplit commented 4 years ago

I noticed the bright halos in the right image, but the problem is that Capture Sharpening causes more dark halos with the same settings as Sharpening – RL Deconvolution. That is evident from the previous comparison where the "brake" of Capture Sharpening is switched off.

There are cases where even 100 iterations of RL Deconvolution are not enough to obtain sharp looking image with acceptable amount of fine detail (increasing the radius beyond 0.7-0.8 is not a solution for me). Unfortunately I cannot provide a RAW file to exemplify this problem, but for some problematic photos I do get sharper results with more fine details from Camera Raw. The given RAW file is a sample produced with expensive equipment and does not need a lot of sharpening anyway.

heckflosse commented 4 years ago

but the problem is that Capture Sharpening causes more dark halos with the same settings as Sharpening – RL Deconvolution:

Trust the auto limit iterations to reduce the dark halos. The result will not be perfect (it can not be perfect as we do not know the exact psf), but imho it is much better than the other RL deconvolution in RT. It works on different data (CS works on linear data, while Sharpening RL deconvolution works on Lab L channel (non-linear))

Unfortunately the documentation of CS is not in rawpedia. But generally it is better to use CS with rcd-demosaic instead of amaze-demosaic because amaze-demosaic is more prone to generate dark artifacts than rcd-demosaic and CS then enhances this even more.

There are cases where even 100 iterations of RL Deconvolution are not enough to obtain sharp looking image with acceptable amount of fine detail (increasing the radius beyond 0.7-0.8 is not a solution for me)

Neither of both (using such a large amount of iterations or increasing the radius beyond what is correct) is what I would do. I usually stick with the default of 20 iterations (limited to even less iterations by auto limit iterations) and (rarely) lowering the radius.

If 20 iterations are not enough to give you more detail then most likely the radius is wrong. Though I gave my best to auto-calculate the radius it might be still sometimes not perfect...

Unfortunately I cannot provide a RAW file to exemplify this problem, but for some problematic photos I do get sharper results with more fine details from Camera Raw.

That's sad, that you can not provide a RAW file :frowning:

heckflosse commented 4 years ago

I noticed the bright halos in the right image

They are not problematic for you? I find them much more problematic than dark halos as bright halos are more eye-catching than dark halos.

teplit commented 4 years ago

Of course the bright halos are problematic - that's why I used initially 50 for the amount of deconvolution.

I decided to share conditionally a problematic RAW file in order to exemplify the difference between Capture Sharpening and Camera Raw sharpening.

First is the RawTherapee's automatic Capture Sharpening (with RCD demosaicing): RawTherapee 3 - with automatic Capture Sharpening

Second is Camera Raw sharpening: Camera Raw

The RAW file is available here for one week: https://filebin.net/8u1poslf6z2g7964 I give you permission to use it only for technical testing of open source projects.

The Camera Raw image obviously contains more artifacts, but it is less fuzzy. When I view this image 1:1 on 24" 4K monitor (~185 pixels per inch) the artifacts are OK for me (yes the sharpening is bit high, but I believe that with less noisy camera sensor the same sharpening will look better).

heckflosse commented 4 years ago

Thanks for the providing the raw :+1:

I agree that for this image the default of 20 iterations is too low

Capture sharpening default (20 iterations) grafik

100 iterations grafik

teplit commented 4 years ago

This photo was taken several years ago with higher aperture then necessary (f/16) and that most likely caused considerable softness. Much later I found that the maximal sharpness for these lens is around f/8. Nowadays I take into consideration this, but sometimes I still get surprisingly soft photos – the problem is that I don’t see clearly the sharpness of the image on the display of my mirrorless camera.

In my opinion the RL Deconvolution of RawTherapee do give better results than Camera Raw’ sharpening for relatively sharp photos (for which 0.7 radius is enough).

heckflosse commented 4 years ago

In my opinion the RL Deconvolution in Details tab of RawTherapee (btw: Capture Sharpening also is RL-Deconvolution) can look sharper (though it is not) than Capture Sharpening because it has more halos than Capture Sharpening. Capture Sharpening tries to avoid this halos.

Another advantages of Capture Sharpening are the Corner radius boost (which increases the radius of the gaussian deconvolution linearly depending on the distance to the center of the image) and the automatic settings (finding good base settings for RL deconvolution in details tab is very time consuming, while the auto radius calculation at least gives a quite good starting value)