Public Shared Sub GrayScale(ByRef bmp As Drawing.Bitmap)
For y As Integer = 0 To bmp.Height - 1
For x As Integer = 0 To bmp.Width - 1
Dim c As Drawing.Color = bmp.GetPixel(x, y)
Dim luma As Integer = CInt(c.R * 0.3 + c.G * 0.59 + c.B * 0.11)
bmp.SetPixel(x, y, Drawing.Color.FromArgb(luma, luma, luma))
Next
Next
End Sub