Enum ThresholdMode
- Namespace
- Egami.Operations
- Assembly
- Egami.dll
What a threshold compares with its level.
public enum ThresholdMode
Fields
Channels = 1Each of red, green and blue on its own, as ImageMagick's -threshold with -channel: each channel takes the matching channel of one of the two colors.
Luminance = 0The pixel's luminance (Rec. 709 weights on the stored values): the whole pixel becomes one of the two colors. The default.
MaxChroma = 3The larger of the pixel's two YCbCr chroma components, as a distance from neutral from 0 to 1.
Saturation = 2The pixel's HSL saturation, so vivid pixels take the upper color and grays the lower one.
Examples
// Two colors: navy below half luminance, cream above; alpha is kept.
using Raster<Rgba8> stamp = raster.Derive(o => o.Threshold(0.5f, ThresholdMode.Luminance, Rgba8.Navy, new Rgba8(250, 240, 220, 255)), Ct);