Difference between revisions of "Edges and Microcontrast"

(Edges)
Line 2: Line 2:
 
__TOC__
 
__TOC__
 
{{1:1}}
 
{{1:1}}
 +
 
==General==
 
==General==
 +
 
{{Sharpening_gallery}}
 
{{Sharpening_gallery}}
  
Unlike ''[[Sharpening#Unsharp_Mask | Unsharp Mask]]'', ''Edges'' is a true sharpening algorithm. It does not introduce halos, it can be used on noisy images and it works in the Lab color space. Edges emphasizes edges only and can be used with Microcontrast to enhance the texture.
+
Unlike ''[[Sharpening#Unsharp_Mask|Unsharp Mask]]'', ''Edges'' is a true sharpening algorithm. It does not introduce halos, it can be used on noisy images and it works in the Lab color space. It emphasizes only the edges, and can be combined with [[Edges_and_Microcontrast#Microcontrast|Microcontrast]] to also enhance the texture.
  
The designer of the 2 algorithms (Edges and Microcontrast) is Manuel LLorens (Perfectraw).  
+
Both algorithms were originally implemented by [https://github.com/ManuelLlorens Manuel LLorens].
  
 
== Edges ==
 
== Edges ==
This tool sharpens any edges that have sufficient contrast for them to be considered as an edge. In other words, it sharpens edges that are already sharp, ignoring edges that do not have enough contrast. As mentioned above, the algorithm is not affected by image noise and does not generate halos.
 
  
This type of sharpening can make the edges look a bit unnatural, as if they had been “cut out”. Also, if the settings are too high, the resulting edges may show "aliasing" (staircase effect). This is why you should be careful when applying it to images with curved edges. However, when straight lines predominate (especially if they are not diagonal), it is a useful method of sharpening, especially if you reduce the size of the image at the end of processing.
+
This tool sharpens any edges that have sufficient contrast for them to be considered an edge. In other words, it sharpens edges that are already sharp, ignoring edges that do not have enough contrast. The algorithm is not affected by image noise and does not generate halos.
 +
 
 +
This type of sharpening can make the edges look a bit unnatural, as if they had been "cut out". Also, if the settings are too high, the resulting edges may exhibit [https://en.wikipedia.org/wiki/Aliasing Aliasing]. This is why you should be careful when applying it to images with curved edges. However, when straight lines predominate (especially if they are not diagonal), it is a useful method of sharpening, especially if you reduce the size of the image at the end of processing.
  
 
To get the best results, the following settings are recommended:
 
To get the best results, the following settings are recommended:
# Iterations (number of iterations carried out by the algorithm): A high number produces an overly sharp effect around the edges. With a value set to 2 this problem can already be observed in some cases. In general, 1 or 2 iterations give the best results.
+
# Iterations: number of iterations carried out by the algorithm. A high number produces an overly sharp effect around the edges. With a value set to 2 this problem can already be observed in some cases. In general, 1 or 2 iterations give the best results.
# Quantity: number of adjacent pixels to be analyzed when deciding what constitutes an edge. Higher values produce sharper edges and a greater "sawtooth" effect.
+
# Quantity: number of adjacent pixels to be analyzed when deciding what constitutes an edge. Higher values produce sharper edges and a greater "saw-tooth" effect.
# Luminance only: the tool works in the L*a*b* color space and with this option, only the L component is enhanced.
+
# Luminance only: the tool works in the L*a*b* color space and with this option, only the L* component is enhanced.
  
 
[[File:edges.jpg|thumb|682px|none|On the left, the original image. On the right, the image with the default "Edges" settings. The arrows indicate much sharper edges when the image is at full scale (at 100%), but if you open the image to view it at 200% or 300% or more, you can clearly see the sawtooth effect and some slight posterization around the edges]]
 
[[File:edges.jpg|thumb|682px|none|On the left, the original image. On the right, the image with the default "Edges" settings. The arrows indicate much sharper edges when the image is at full scale (at 100%), but if you open the image to view it at 200% or 300% or more, you can clearly see the sawtooth effect and some slight posterization around the edges]]
Line 24: Line 27:
  
 
== Microcontrast ==
 
== Microcontrast ==
Microcontrast is a concept aimed at the distinction or separation of a pixel from its immediate neighbors. Sometimes it is simply called contrast. However, an image with low microcontrast will have a number of neighboring pixels with similar values, meaning that there will be a number of areas without relief and hardly any detail. On the contrary, an image with a lot of microcontrast will allow you to distinguish the smallest details down to the pixel level and you will be able to differentiate a pixel from its neighbors.
 
 
For this reason, it is not recommended to consider the Microcontrast tool as another sharpening method, but as a way of improving the tonal graduations of an image i.e. it is about improving the distinction between different tones at the pixel level, so that the image has better textures and more depth in the lighter and darker areas.
 
 
Microcontrast is an often difficult to explain image characteristic that depends on several factors:
 
 
* the quality of the lens for the most part. There are lenses that are considered excellent but have poor microcontrast.
 
* the characteristics of the sensor and the demosaicing algorithm (Amaze, AHD, VNG4, etc.), which have an important impact on the microcontrast (diagonals, colors, noise...).
 
* whether the sensor is equipped with an anti-aliasing filter or not (it will remove the finest details).
 
* whether the lens can differentiate details as fine as those captured by the sensor.
 
* the presence of reflections inside the lens or even inside the camera when the image is shot. In these cases, blacks become dark gray and whites become light gray, which reduces contrast.
 
* whether the aperture has been stopped down to improve the depth of field: the higher the f-number selected, the lower the microcontrast of the photo.
 
* whether the aperture has been stopped down too much and introduced diffraction.
 
 
<div class="img-comp-wrapper img-comp-right">
 
<div class="thumbinner thumbcompare tnone" style="width: 877px">
 
<imgcomp img1='microcontrast-off.jpg' img2='microcontrast-on.jpg'  width=877/>
 
<div class="thumbcaption">
 
Using the Microcontrast tool: although you shouldn't expect dramatic changes, the difference is noticeable, especially in the orange and beige feathers, as well as in the legs and the texture of the wooden beam. The image is more tactile, more real.<br/><small>''Original image from [http://www.photographyblog.com Photography Blog]''</small>
 
</div>
 
</div>
 
</div>
 
An image with good microcontrast will have a look, a quality that will stand out compared to the same image without microcontrast.
 
 
 
 
 
 
  
 +
"Microcontrast" can be defined as contrast on a pixel level[https://web.archive.org/web/20110625093654/http://www.rawness.es/sharpening/?lang=en#comment-306], as opposed to "local contrast" which pertains to contrast between larger (lower frequency) areas.
  
 +
The Microcontrast tool increases the contrast of a pixel relative to its neighbors, effectively leading to an apparent increase in texture. The intention is to allow recovering texture lost due to noise reduction. It does not introduce halos.[https://web.archive.org/web/20100324142513/http://www.rawness.es/contraste-local-y-microcontraste/?lang=en]
  
 +
[[File:seagull-microcontrast.jpg|thumb|none|800px|Example of Microcontrast.]]
  
 
The tool's controls are progressive and allow you to choose a balance between increasing the contrast at the pixel level and the appearance of artifacts:
 
The tool's controls are progressive and allow you to choose a balance between increasing the contrast at the pixel level and the appearance of artifacts:
  
 
+
* Contrast threshold: sets the minimum contrast at which the tool will act on the pixels.
 
 
 
 
* Contrast Threshold: sets the minimum contrast at which the tool will act on the pixels.
 
 
* Quantity: the intensity of the effect. The higher the value, the greater the difference between the pixels.
 
* Quantity: the intensity of the effect. The higher the value, the greater the difference between the pixels.
 
* Uniformity: to the left, the algorithm tends to respect the initial contrast gradients. To the right, the contrasts are more intense and the initial contrast gradients are ignored, which makes the image harsher.
 
* Uniformity: to the left, the algorithm tends to respect the initial contrast gradients. To the right, the contrasts are more intense and the initial contrast gradients are ignored, which makes the image harsher.
* Matrix: defines the area that will be used to calculate the contrast variation. There are two possibilities, a 3x3 pixel matrix around the pixel being analyzed, or a"5x5" pixel matrix. By default, it will be 5x5, giving a more intense effect, the 3x3 matrix will be more appropriate for noisy images.
+
* Matrix: defines the area that will be used to calculate the contrast variation. There are two possibilities, a 3x3 pixel matrix around the pixel being analyzed, or a 5x5 pixel matrix. By default, it will be 5x5, giving a more intense effect, the 3x3 matrix will be more appropriate for noisy images.
 
 
[[File:seagull-microcontrast.jpg|thumb|none|800px|Another example of the difference with and without the microcontrast tool: on the left, an image without microcontrast. On the right, the same image with microcontrast added. The texture is more apparent.]]
 

Revision as of 22:03, 3 June 2021

Edges and Microcontrast

The effects of this tool are only visible at a preview scale of 1:1 or more. Use a detail window (click on the Window-add.png icon under the main preview panel) to inspect a part of the image, or zoom the main preview to 100% (also called 1:1) Magnifier-1to1.png.


1 General

Unlike Unsharp Mask, Edges is a true sharpening algorithm. It does not introduce halos, it can be used on noisy images and it works in the Lab color space. It emphasizes only the edges, and can be combined with Microcontrast to also enhance the texture.

Both algorithms were originally implemented by Manuel LLorens.

2 Edges

This tool sharpens any edges that have sufficient contrast for them to be considered an edge. In other words, it sharpens edges that are already sharp, ignoring edges that do not have enough contrast. The algorithm is not affected by image noise and does not generate halos.

This type of sharpening can make the edges look a bit unnatural, as if they had been "cut out". Also, if the settings are too high, the resulting edges may exhibit Aliasing. This is why you should be careful when applying it to images with curved edges. However, when straight lines predominate (especially if they are not diagonal), it is a useful method of sharpening, especially if you reduce the size of the image at the end of processing.

To get the best results, the following settings are recommended:

  1. Iterations: number of iterations carried out by the algorithm. A high number produces an overly sharp effect around the edges. With a value set to 2 this problem can already be observed in some cases. In general, 1 or 2 iterations give the best results.
  2. Quantity: number of adjacent pixels to be analyzed when deciding what constitutes an edge. Higher values produce sharper edges and a greater "saw-tooth" effect.
  3. Luminance only: the tool works in the L*a*b* color space and with this option, only the L* component is enhanced.
On the left, the original image. On the right, the image with the default "Edges" settings. The arrows indicate much sharper edges when the image is at full scale (at 100%), but if you open the image to view it at 200% or 300% or more, you can clearly see the sawtooth effect and some slight posterization around the edges

Additional information can be found here:: https://web.archive.org/web/20110625093654/http://www.rawness.es/sharpening/?lang=en

3 Microcontrast

"Microcontrast" can be defined as contrast on a pixel level[1], as opposed to "local contrast" which pertains to contrast between larger (lower frequency) areas.

The Microcontrast tool increases the contrast of a pixel relative to its neighbors, effectively leading to an apparent increase in texture. The intention is to allow recovering texture lost due to noise reduction. It does not introduce halos.[2]

Example of Microcontrast.

The tool's controls are progressive and allow you to choose a balance between increasing the contrast at the pixel level and the appearance of artifacts:

  • Contrast threshold: sets the minimum contrast at which the tool will act on the pixels.
  • Quantity: the intensity of the effect. The higher the value, the greater the difference between the pixels.
  • Uniformity: to the left, the algorithm tends to respect the initial contrast gradients. To the right, the contrasts are more intense and the initial contrast gradients are ignored, which makes the image harsher.
  • Matrix: defines the area that will be used to calculate the contrast variation. There are two possibilities, a 3x3 pixel matrix around the pixel being analyzed, or a 5x5 pixel matrix. By default, it will be 5x5, giving a more intense effect, the 3x3 matrix will be more appropriate for noisy images.