Exemplo n.º 1
0
        private byte[] GetMonohromePixel(byte[] pixel, int byteLength, int coefficient)
        {
            Color color = PixelOperations.TransformPixelToColor(pixel, byteLength);
            Color newColor;

            if ((color.B + color.G + color.R) / 3 < coefficient)
            {
                newColor = SetNewColor(color, secondColor);
            }
            else
            {
                newColor = SetNewColor(color, firstColor);
            }
            pixel = PixelOperations.TransformColorToPixel(newColor, byteLength);
            return(pixel);
        }