I am trying to remove a greyish background from a photo and replace it with a white one
so far I have this code:
image = cv2.imread(args[\"image\"])
You can use the mask to index the array, and assign just the white parts of the mask to white:
coloured = resized.copy() coloured[mask == 255] = (255, 255, 255)