




'''simple docstring'''



from PIL import Image
def 			SCREAMING_SNAKE_CASE_			(							__A    :			Image  )			->			Union[str, Any]:
   _SCREAMING_SNAKE_CASE	=				image.size
   _SCREAMING_SNAKE_CASE	=				0
   _SCREAMING_SNAKE_CASE	=				image.load()
   for i in range(_a  ):
      for j in range(_a  ):
         _SCREAMING_SNAKE_CASE	=				pixels[j, i]
         mean += pixel
   mean //= width * height

   for j in range(_a  ):
      for i in range(_a  ):
         _SCREAMING_SNAKE_CASE	=				2_55 if pixels[i, j] > mean else 0
   return image


if __name__ == "__main__":
 lowerCamelCase_			=						mean_threshold(Image.open('path_to_image').convert('L'))
 image.save('output_image_path')







'''simple docstring'''



lowerCamelCase_			=						'Tobias Carryer'

from time import time







class 		lowercase_   :


   """simple docstring"""

   def __init__(   self :     Tuple  ,				__lowerCamelCase :     int  ,				__lowerCamelCase :     List[Any]  ,				__lowerCamelCase :     Optional[int]  ,				__lowerCamelCase :     Dict=int(time()   )   ):  # noqa: B008

      """simple docstring"""
      _SCREAMING_SNAKE_CASE	=				multiplier
      _SCREAMING_SNAKE_CASE	=				increment
      _SCREAMING_SNAKE_CASE	=				modulo
      _SCREAMING_SNAKE_CASE	=				seed



   def 							lowerCAmelCase_      (   self :     List[str]   ):

      """simple docstring"""
      _SCREAMING_SNAKE_CASE	=				(self.multiplier * self.seed + self.increment) % self.modulo
      return self.seed


if __name__ == "__main__":
 # Show the LCG in action.
 lowerCamelCase_			=						LinearCongruentialGenerator(1_66_45_25, 10_13_90_42_23, 2 << 31)
 while True:
  print(lcg.next_number())

