






from PIL import Image


def 				snake_case__							(							UpperCAmelCase							:  Image    ,			UpperCAmelCase							:  float       ):

    def brightness(UpperCAmelCase							:  int       ) -> float:
        return 1_2_8 + level + (c - 1_2_8)

    if not -255.0 <= level <= 255.0:
        raise ValueError("level must be between -255.0 (black) and 255.0 (white)"       )
    return img.point(UpperCAmelCase       )


if __name__ == "__main__":
 # Load image
 with Image.open("""image_data/lena.jpg""") as img:
  # Change brightness to 100
  _a    :   Dict        =			change_brightness(img, 100)
  brigt_img.save("""image_data/lena_brightness.png""", format="""png""")











def 				snake_case__							(							UpperCAmelCase							:  str       ):
    return "".join(chr(ord(UpperCAmelCase       ) - 3_2       ) if "a" <= char <= "z" else char for char in word       )


if __name__ == "__main__":
 from doctest import testmod

 testmod()



