

from cva import destroyAllWindows, imread, imshow, waitKey



def   UpperCamelCase(   lowercase_     ,   lowercase_				)      ->							int:





  '''simple docstring'''





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

  def to_grayscale(lowercase_     ,   lowercase_     ,   lowercase_				):
    return 0.21_26 * red + 0.5_87 * green + 0.1_14 * blue

  def normalize(lowercase_				):
    return min(lowercase_     ,   255				)

  for i in range(lowercase_				):
    for j in range(lowercase_				):
      snake_case_					= int(to_grayscale(*img[i][j]				)				)
      snake_case_					= [
          normalize(lowercase_				),
          normalize(greyscale + factor				),
          normalize(greyscale + 2 * factor				),
      ]

  return img


if __name__ == "__main__":
    # read original image
    lowerCamelCase_					  =   {
        percentage: imread('''image_data/lena.jpg''', 1) for percentage in (10, 20, 30, 40)
    }

    for percentage, img in images.items():
        make_sepia(img, percentage)

    for percentage, img in images.items():
        imshow(f"""Original image with sepia (factor: {percentage})""", img)

    waitKey(0)
    destroyAllWindows()


def   UpperCamelCase(   lowercase_ = 100     ,   lowercase_ = 100				)      ->							int:





  '''simple docstring'''





  return max(
      sum(int(lowercase_				) for x in str(base**power				)				)
      for base in range(lowercase_				)
      for power in range(lowercase_				)				)


# Tests
if __name__ == "__main__":
    import doctest

    doctest.testmod()