so what I'm doing is creating a simple green screen image maker in vb.net. My code is quite simple (albeit probably not the most efficient)
Dim overlay As Bitmap = New Bitmap(My.Resources.GreenScreen)
Dim backImage As Bitmap = New Bitmap(My.Resources.Tunnel)
Dim x As Integer
Dim y As Integer
For x = 0 To overlay.Width - 1
For y = 0 To overlay.Height - 1
Dim pixelColor As Color = overlay.GetPixel(x, y)
If pixelColor = Color.FromArgb(255, 0, 254, 0) Then
overlay.MakeTransparent(overlay.GetPixel(x, y))
End If
Next
Next
Dim g As Graphics = Graphics.FromImage(backImage)
g.DrawImage(overlay, 0, 0)
PictureBox1.Image = backImage
but for now it works, and I'm happy with it (sort of)
What I am facing is that I've downloaded a sample image of someone stood in front of a green screen. The above code removes the majority of the green, but not all. I need to feather the edge of the subject (I think that's what it's called anyway).
What I was thinking was that I need to catch all the different shades of green in the image, is there a way I can specify a max and min range for the RGB?