public ImageFilter(Bitmap Img) { if (Img.PixelFormat != System.Drawing.Imaging.PixelFormat.Format24bppRgb && Img.PixelFormat != System.Drawing.Imaging.PixelFormat.Format32bppArgb) { this.Img = ImageArithmetic.toGray(Img); } else { this.Img = Img; } }