Reducing halos on major edges in AS (semi-interactively)

Moderator: jsachs

tomczak
Posts: 661
Joined: April 25th, 2009, 12:56 am

Reducing halos on major edges in AS (semi-interactively)

Postby tomczak » February 20th, 2014, 10:39 am

In AS (sharpen tab), high frequency features, such as noise, can be protected from being sharpened by using lower roughness thresholds (i.e. black and withe sliders under the roughness histogram). There is no upper threshold control (i.e. everything 'rougher' than the withe slider threshold gets effectively sharpened), which often makes it difficult to properly sharpen an image without ruining the picture with ugly halos on major contrasty edges.

The following procedure helps minimizing such halos in a relatively simple single semi-automatic setup:

1) open the Mask dialog and create a texture mask (I.e. edge mask with more controls), blur this mask,

2) open the AS with the mask loaded - flip white and black Amount sliders (Ctrl + Select Amount Mask button) so that the halo-producing edges are masked (and thus not sharpened); sharpen through the mask.

The process is semi-automatic in that the Mask Control Dialog can be kept open along with AS dialog, allowing to adjust the mask and AS parameters concurrently (with the goal of protecting from being sharpened both: low frequency noise with AS roughness threshold sliders and the major, halo-producing edges with the edge mask).

NB. using edge mask to protect edges is a little different from roughness threshold in AS: the former excludes masked input pixels from being replaced by the output pixels, the latter excludes pixels ''smoother' (and potentially 'rougher') than the set threshold from contributing to the sharpening neighborhood kernel calculations for each pixel being sharpened (at least this is how I understand it).
Maciej Tomczak
Phototramp.com

tomczak
Posts: 661
Joined: April 25th, 2009, 12:56 am

Re: Reducing halos on major edges in AS (semi-interactively)

Postby tomczak » February 22nd, 2014, 1:01 pm

This may be a useful when using the method above:

- the edge mask doesn't have to be blurred at all or can be blurred only slightly (radius=1 or 2) to be most effective - it just needs to cover major visible halos; blurring the edge mask too much will 'misalign' and/or water down the mask and will fail to dampen the halos.

- threshold sliders under texture histogram in Mask control panel are v. useful in constructing the proper edge mask so that it actually covers those halos and not much more.

- the texture mask's Method set to 'difference from average' works well for covering halos, which makes sense to me as this methods seems to follow similar calculations as in the USM-style sharpening: it compares the central pixel value with a (weighted?) average the neighborhood's pixels values.

- regardless of the edge construction method, the edge mask is likely to be just an approximation of the oversharpened halos (as it merely tries to crudely mimic what the upper roughness threshold slider could potentially exclude from sharpening), and may either miss some of them or impede sharpening elsewhere too much. This is because the AS and the Texture Mask define 'edges' differently (see NB above) and what's being over-sharpened and what's masked may not overlap.

- despite its relative simplicity, the setup advocated above requires a bit of work to adjust properly.
Maciej Tomczak
Phototramp.com

tomczak
Posts: 661
Joined: April 25th, 2009, 12:56 am

Re: Reducing halos on major edges in AS (semi-interactively)

Postby tomczak » February 22nd, 2014, 11:45 pm

Here is the illustration of the setup:

From left to right, clockwise: output preview window, input window (with mask in red), texture Mask control window, AS (sharpen tab) control window.

Note: this method tries to block halos on major edges that AS can produce. It does not separate white and black overshoots - reducing only one of them (typically white halos on the bright side of the edge, as in this example) could make the sharpening even more effective, and the image more pleasing overall.

This is possible, but requires additional steps (compositing sharpened image with the unsharpened original in 'darken' mode). This will take away the bright part of the halos, but for all sharpened elements of the image, not just the major edges - to take out only white halos, only on major edges, a major-edge mask (same as above) can be used in the Composite.
Attachments
2014-02-23_101837.png
2014-02-23_101837.png (72.62 KiB) Viewed 7738 times
Maciej Tomczak
Phototramp.com

den
Posts: 612
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Reducing halos on major edges in AS (semi-interactively)

Postby den » March 30th, 2014, 4:01 pm

This is an addendum to Maciej's discussion above with additional illustrations resulting from a recent intense series of experiments of PWPro 32 v7.0.12's Advanced Sharpen - Sharpen tab...

...the following seems to be reasonably generic for 3456x2304 pixel, 48-bit color, nature landscape images with fine [small] detail...

While the suggested major edge mask does not separate and make adjustable the edge dark/light undershoot/overshoot:
...it does provide a gradient from the major edge with the largest contrast to edges with lesser contrasts within the selected edge threshold range where the black slider sets threshold and the white slider adjusted to the right most end of the histogram provides the largest to lesser edge contrast gradient...
...if the Mask tool - Texture's Neighborhood Size is set to the AS-Sharpen Radius, then the masked edge widths are nearly that of the edge pixels affected by AS...
...preserves the AS sharpening effect to the majority of the Input image areas represented to the left of the black slider's histogram Threshold setting...
...allows setting the AS sharpening effect to the major edges to a lesser amount where the dark/light undershoot/overshoot will not be objectionable...

The illustrated AS - Sharpen tab settings are my 'Save As Default' settings:...
...Sharpen Radius 5; Sharpen Amount 50; Threshold (black slider) just to the right of the histogram peak; and Blend (white slider) pointer beneath the Threshold bottom right corner...

These initial settings will generally produce an over sharpened Preview [1:1 Zoom factor to avoid anti-aliasing artifacts] image whose minor/major edge contrasts amounts can be reduced to preference using the black/white AS transform Amount sliders when the 'active' mask is selected...

Perhaps to be more technically correct the suggested major Edge mask should be applied to the Extract-ed RGB-Luminance channel of the AS Input image rather than the Mask Tool - Brightness Curve's starting image's HSV-Value histogram but this is a nuance that will go largely un-noticed for most photo-realistic images...

The attached illustrations show a 1:1 Zoom factor IMG_0991 [Lower Yellowstone River Falls & Canyon] image area crop at a 70-75% jpeg compresion for posting... ...the bottom illustration shows a Preview where both mask black = mask white = 100 or 'No Mask'.

...den...
Attachments
AS_setup.jpg
AS_setup.jpg (48.37 KiB) Viewed 7561 times
AS_InputMask_15white-70black.jpg
AS_InputMask_15white-70black.jpg (48.69 KiB) Viewed 7556 times
AS_InputMask_100white-100black.jpg
AS_InputMask_100white-100black.jpg (48.34 KiB) Viewed 7559 times

tomczak
Posts: 661
Joined: April 25th, 2009, 12:56 am

Re: Reducing halos on major edges in AS (semi-interactively)

Postby tomczak » April 5th, 2014, 10:17 am

There is another method that can simulate upper roughness threshold in AS Sharpen tab:

1) Use AS Noise Reduction Tab (not Sharpen), blur the image while protecting major edges with (upper) roughness threshold sliders: what's blurred will become sharpened.
2) Subtract the blurred version from the original in offset mode
3) Composite the original with the latter in Soft/Hard Light mode.

Hard Light is probably closer then Soft Light in the last step, when trying to mimic what AS Sharpen would do natively.
Maciej Tomczak
Phototramp.com


Return to “Picture Window Tips”

Who is online

Users browsing this forum: No registered users and 1 guest