Accord.Imaging.Image.CreateGrayscaleImage C# (CSharp) Method

CreateGrayscaleImage() public static method

Create and initialize new 8 bpp grayscale image.
The method creates new 8 bpp grayscale image and initializes its palette. Grayscale image is represented as Format8bppIndexed image with palette initialized to 256 gradients of gray color.
public static CreateGrayscaleImage ( int width, int height ) : Bitmap
width int Image width.
height int Image height.
return System.Drawing.Bitmap
        public static Bitmap CreateGrayscaleImage(int width, int height)
        {
            // create new image
            Bitmap image = new Bitmap(width, height, PixelFormat.Format8bppIndexed);
            // set palette to grayscale
            SetGrayscalePalette(image);
            // return new image
            return image;
        }