Processes an image based on its RGB values