It is described here: https://pillow.readthedocs.io/en/latest/handbook/tutorial.html#point-operations that point operations can be used to adjust the image based on its valu