How would I take an RGB image in Python and convert it to black OR white? Not grayscale, I want each pixel to be either fully black (0, 0, 0) or fully white (255, 255, 255).
I would suggest converting to grayscale, then simply applying a threshold (halfway, or mean or meadian, if you so choose) to it.
from PIL import Image col = Image.open('myimage.jpg') gry = col.convert('L') grarray = np.asarray(gry) bw = (grarray > grarray.mean())*255 imshow(bw)