See the Remarks section for details.
Assembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 5.1.0
public OrderedDitherer ConfigureStrength( float strength )
Public Function ConfigureStrength ( strength As Single ) As OrderedDitherer
public: OrderedDitherer^ ConfigureStrength( float strength )
member ConfigureStrength : strength : float32 -> OrderedDitherer
- Type: SystemSingle
The strength of the dithering effect between 0 and 1 (inclusive bounds). Specify 0 to use an auto value for each dithering session based on the used quantizer.
Return ValueType: OrderedDitherer
A new OrderedDitherer instance that has the specified dithering strength.
|ArgumentOutOfRangeException||strength must be between 0 and 1, inclusive bounds.|
|This method always returns a new OrderedDitherer instance instead of changing the strength of the original one. This is required for the static properties so they can return a cached instance.|
If strength is too low, then banding may appear in the result in place of gradients in the original image; whereas if strength is too high, then dithering patterns may appear even in colors without quantization error (overdithering).
If strength is 0, then strength will be calibrated for each dithering session so that neither the black, nor the white colors will suffer from overdithering in the result. This is the default for OrderedDitherer instances returned by the static properties.
The following table demonstrates the effect of different strengths:
|Original image||Quantized image|
// getting a predefined ditherer with custom strength: IDitherer ditherer = OrderedDitherer.Bayer8x8.ConfigureStrength(0.5f);