


"""simple docstring"""







def   UpperCAmelCase__			(lowerCAmelCase_    ,		lowerCAmelCase_  ):




					'''simple docstring'''


					if a < 0 or b < 0:
										raise ValueError("the value of both inputs must be positive"  )

					__SCREAMING_SNAKE_CASE		  =							str(bin(UpperCamelCase__  )  )[2:]  # remove the leading "0b"
					__SCREAMING_SNAKE_CASE		  =							str(bin(UpperCamelCase__  )  )[2:]  # remove the leading "0b"

					__SCREAMING_SNAKE_CASE		  =							max(len(UpperCamelCase__  )    ,		len(UpperCamelCase__  )  )

					return "0b" + "".join(
					    str(int(char_a == "1" and char_b == "1"  )  )
					    for char_a, char_b in zip(a_binary.zfill(UpperCamelCase__  )    ,		b_binary.zfill(UpperCamelCase__  )  )  )


if __name__ == "__main__":
		import doctest

		doctest.testmod()




"""simple docstring"""

from PIL import Image


def lowerCAmelCase_   (					UpperCamelCase__						:			Image					, UpperCamelCase__						:			int			):






 """simple docstring"""







 __lowercase						=						(259 * (level + 255)) / (255 * (259 - level))

 def contrast(UpperCamelCase__						:			int			) -> int:
  return int(128 + factor * (c - 128)			)

 return img.point(UpperCamelCase__			)


if __name__ == "__main__":
       # Load image
       with Image.open("image_data/lena.jpg") as img:
              # Change contrast to 170
              UpperCAmelCase__					=change_contrast(img, 170)
              cont_img.save("image_data/lena_high_contrast.png", format="png")
