I have an image with a noisy background like this (blown-up, each square is a pixel). I'm trying to normalize the black background so that I can replace the color entirely.
This is what I'm thinking (psuedo code):
for pixel in image:
if is_similar(pixel, (0, 0, 0), threshold):
pixel = (0, 0, 0)
What sort of function would allow me to compare two color values to match within a certain threshold?