Here are the incantations you need to perform to create a Cairo surface from a grayscale image in a Numpy array, doodle on it, and convert the doodled-upon image back into a Pillow image so you can save it as e.g. a JPEG.