3.4. NL-filteret

3.4.1. Oversyn

Figur 16.23. Eksempel på bruk av filteret

Eksempel på bruk av filteret

Original image

Eksempel på bruk av filteret

Etter bruk av filteret


NL means “Non Linear”. Derived from the Unix pnmnlfilt program, it joins smoothing, despeckle and sharpen enhancement functions. It works on the whole layer, not on the selection.

Dette er litt av eit universalfilter med tre distinkte operasjonsmodus. Filteret analyserer kvar piksel i biletet og endrar desse ut frå innstillinga du har vald og ut frå verdien på pikselen og nabopikslane. I staden for å bruke den vanlege 3 × 3 blokka, bruker filteret sekskanta blokker rundt sentrumspikselen. Storleiken på desse blokkene blir bestemt ut frå kva radius du har sett i innstillingane.

3.4.2. Activating the filter

You can find this filter through FiltersEnhanceNL Filter.

The filter does not work if the active layer has an alpha channel. Then the menu entry is insensitive and grayed out.

3.4.3. Innstillingar

Figur 16.24. Innstillingane for “NL-filteret

Innstillingane for NL-filteret

Førehandsvising

When checked, parameter setting results are interactively displayed in preview.

Filter

The Operating Mode is described below.

Alpha

Controls the amount of the filter to apply. Valid range is 0.00-1.00. The exact meaning of this value depends on the selected operating mode. Note that this parameter is related to but not the same as the alpha parameter used in the pnmnlfilt program.

Radius

Controls the size of the effective sampling region around each pixel. The range of this value is 0.33-1.00, where 0.33 means just the pixel itself (and thus the filter will have no effect), and 1.00 means all pixels in the 3x3 grid are sampled.

3.4.4. Filter

This filter can perform several distinct functions:

Alpha trimmed mean

The value of the center pixel will be replaced by the mean of the 7 hexagon values, but the 7 values are sorted by size and the top and bottom Alpha portion of the 7 are excluded from the mean. This implies that an Alpha value of 0.0 gives the same sort of output as a normal convolution (i.e. averaging or smoothing filter), where Radius will determine the “strength” of the filter. A good value to start from for subtle filtering is Alpha = 0.0, Radius = 0.55. For a more blatant effect, try Alpha = 0.0 and Radius = 1.0.

An Alpha value of 1.0 will cause the median value of the 7 hexagons to be used to replace the center pixel value. This sort of filter is good for eliminating “pop” or single pixel noise from an image without spreading the noise out or smudging features on the image. Judicious use of the Radius parameter will fine tune the filtering.

Intermediate values of Alpha give effects somewhere between smoothing and "pop" noise reduction. For subtle filtering try starting with values of Alpha = 0.8, Radius = 0.6. For a more blatant effect try Alpha = 1.0, Radius = 1.0 .

Optimal estimation

This type of filter applies a smoothing filter adaptively over the image. For each pixel the variance of the surrounding hexagon values is calculated, and the amount of smoothing is made inversely proportional to it. The idea is that if the variance is small then it is due to noise in the image, while if the variance is large, it is because of “wanted” image features. As usual the Radius parameter controls the effective radius, but it probably advisable to leave the radius between 0.8 and 1.0 for the variance calculation to be meaningful. The Alpha parameter sets the noise threshold, over which less smoothing will be done. This means that small values of Alpha will give the most subtle filtering effect, while large values will tend to smooth all parts of the image. You could start with values like Alpha = 0.2, Radius = 1.0, and try increasing or decreasing the Alpha parameter to get the desired effect. This type of filter is best for filtering out dithering noise in both bitmap and color images.

Edge enhancement

This is the opposite type of filter to the smoothing filter. It enhances edges. The Alpha parameter controls the amount of edge enhancement, from subtle (0.1) to blatant (0.9). The Radius parameter controls the effective radius as usual, but useful values are between 0.5 and 0.9. Try starting with values of Alpha = 0.3, Radius = 0.8.

3.4.4.1. Filterkombinasjonar

Det er ingenting i vegen for å køyre eit filter fleire gonger, eller å bruke ulike filter på same biletet. Ønskjer du for eksempel å gjere eit uskarpt monokromatisk bilete om til eit gråskalabilete, kan du prøve ein eller to rundar med utglattingsfilteret (Alfabasert middelverdi) og deretter ei gjennomkøyring med filteret Optimalt overslag. Til slutt prøver du ei forsiktig kantforbetring. Som oftast blir resultatet best når du køyrer kantforbetringa til slutt i prosessen. Dette fordi kantforbetring er det motsette av utglatting.

For reducing color quantization noise in images (i.e. turning .gif files back into 24 bit files) you could try a pass of the optimal estimation filter (Alpha = 0.2, Radius = 1.0), a pass of the median filter (Alpha = 1.0, Radius = 0.55), and possibly a pass of the edge enhancement filter. Several passes of the optimal estimation filter with declining Alpha values are more effective than a single pass with a large Alpha value. As usual, there is a trade-off between filtering effectiveness and losing detail. Experimentation is encouraged.