Class AdaptiveWhiteStretchFilterOptions

Class AdaptiveWhiteStretchFilterOptions

Namespace: Aspose.Imaging.ImageFilters.FilterOptions
Assembly: Aspose.Imaging.dll (25.12.0)

Provides options for configuring the Adaptive White Stretch filter. Allows customization of histogram stretch parameters to enhance the white level and improve the readability of faint-text or low-contrast document images.

public class AdaptiveWhiteStretchFilterOptions : FilterOptionsBase

Inheritance

object FilterOptionsBase AdaptiveWhiteStretchFilterOptions

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

AdaptiveWhiteStretchFilterOptions(bool, int, int, int, float)

Initializes a new instance of the Aspose.Imaging.ImageFilters.AdaptiveWhiteStretchFilter class.

public AdaptiveWhiteStretchFilterOptions(bool isGrayscale = false, int lowPercentile = 10, int highPercentile = 90, int targetWhite = 240, float maxScale = 1.7)

Parameters

isGrayscale bool

Indicates whether the filter should operate in grayscale mode.

lowPercentile int

Lower percentile for black point (e.g. 10).

highPercentile int

Upper percentile for white point (e.g. 90).

targetWhite int

Target white value (e.g. 240).

maxScale float

Maximum allowed brightness scale (e.g. 1.7).

Remarks

The algorithm stretches the histogram so that the white percentile approaches targetWhite, but without exceeding maxScale to avoid over-brightening.

Properties

HighPercentile

Gets the upper percentile for white point calculation. Pixel values above this percentile are considered as white during stretching.

public int HighPercentile { get; }

Property Value

int

IsGrayscale

Gets a value indicating whether the filter operates in grayscale mode.

public bool IsGrayscale { get; }

Property Value

bool

LowPercentile

Gets the lower percentile for black point calculation. Pixel values below this percentile are considered as black during stretching.

public int LowPercentile { get; }

Property Value

int

MaxScale

Gets the maximum allowed brightness scale. The actual stretching will not exceed this factor, to avoid over-brightening.

public float MaxScale { get; }

Property Value

float

TargetWhite

Gets the target white value the stretch aims to achieve.

public int TargetWhite { get; }

Property Value

int