Color document filter. This filter is a good starting point for most use cases.

Constructors

Properties

_type: "ColorDocumentFilter"
blackOutliersFraction: number

Clip this fraction of the darkest pixels in operations such as autocontrast. Increasing the range of middle gray levels at the expense of the brightest and darkest levels may improve the overall contrast and quality of the result. Sum of blackOutliersFraction and whiteOutliersFraction must be less than 1 but usually good values for the parameters do not exceed 0.05;.

Default Value

0.0;
borderWidthFraction: number

Ignore this fraction of pixels at the edge of the image when calculating statistics. Pixels at the edge of the image typically have poor statistics. Ignoring them and using only the inner pixels when calculating certain statistics can substantially improve the quality of the result. The value must be less than 0.5 but usually good values are between 0 and 0.15.

Default Value

0.06;
colorEnhancement: number

Strength of color saturation enhancement. Typical values are between 0 and 1, although higher values are possible.

Default Value

0.5;
contrastEnhancement: number

Strength of contrast enhancement. Typical values are between 0 and 1, although higher values are possible.

Default Value

0.5;
paperWhitening: number

Paper whitening strength balances color enhancement and paper color improvement. Only relevant if colorEnhancement is above 0. Typical values are between 0 and 2.

Default Value

1.0;
paperWhiteningBias: number

Paper whitening bias balances between whitening more of the paper of preserving more of the colors. Negative values will preserve more colors, positive values will whiten more of the paper. Only relevant if colorEnhancement is above 0. Typical values are between -25 and 25.

Default Value

0;
radius: number

Filter radius. The bigger the radius, the slower the filter and generally the less noise in the result. The radius is used for both shadows removal and the calculation of local statistics in the main body of the filter. Higher radius usually allows to cope better with regions of light text on dark background. All the values larger than 127 are clamped to 127.

Default Value

32;
whiteOutliersFraction: number

Clip this fraction of the brightest pixels in operations such as autocontrast. Increasing the range of middle gray levels at the expense of the brightest and darkest levels may improve the overall contrast and quality of the result. Sum of blackOutliersFraction and whiteOutliersFraction must be less than 1 but usually good values for the parameters do not exceed 0.05;.

Default Value

0.02;

Generated using TypeDoc