





from PIL import Image





def   lowerCamelCase__       (       UpperCamelCase__     :    Image    ,      UpperCamelCase__     :    float  )     ->	Image:



					'''simple docstring'''




					def brightness(UpperCamelCase__     :    int  ) -> float:
										return 128 + level + (c - 128)

					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
										UpperCAmelCase_											=       change_brightness(img, 100)
										brigt_img.save("""image_data/lena_brightness.png""", format="""png""")










from cva import destroyAllWindows, imread, imshow, waitKey





def   lowerCamelCase__       (       UpperCamelCase__     :    Dict  )     ->	Optional[Any]:



					'''simple docstring'''




					_snake_case							,       _snake_case													=			img.shape[0], img.shape[1]

					# converting each pixel's color to its negative
					for i in range(UpperCamelCase__  ):
										for j in range(UpperCamelCase__  ):
															_snake_case													=			[255, 255, 255] - img[i][j]

					return img


if __name__ == "__main__":
					# read original image
					UpperCAmelCase_ 							=       imread("""image_data/lena.jpg""", 1)

					# convert to its negative
					UpperCAmelCase_ 							=       convert_to_negative(img)

					# show result image
					imshow("""negative of original image""", img)
					waitKey(0)
					destroyAllWindows()



