I am trying to understand the function equalize in PIL library (https://github.com/python-pillow/Pillow/blob/master/src/PIL/ImageOps.py#L326). In this function,
equalize