I have a lot of pictures (about 10.000) and would need to paint with Pink on every pixel that is white.
I found multiple threads on getting the color of a pixel, but they require me to go over every pixel of every image and verify if it is white. On the other hand in python it can be done extremely quickly with numpy.
Is there a way to select only the white pixels quickly and paint over them in vb.net? maybe using gr.ExcludeClip() or something like that?
any help appreciated.
UPDATE with the current code
Dim im As Image = Image.FromFile(imagepath & "\" & imagename)
Dim palette = im.Palette
Dim c As Color = Color.FromArgb(R, G, B)
Dim mapWhite = New Imaging.ColorMap() With {
.OldColor = Color.White,
.NewColor = c
}
For i As Integer = 0 To palette.Entries.Length - 1
If palette.Entries(i) = mapWhite.OldColor Then
palette.Entries(i) = mapWhite.NewColor
End If
Next
im.Palette = palette