public override ColorBgra Apply(ColorBgra color) { byte value = color.MaxDeviance(FilterColor); if (Grayscale) { if (!Invert) { value = (byte)(255 - value); } return(ColorBgra.FromBgr(value, value, value)); } return(value < Tolerance ? TransparentColor : OpaqueColor); }