



'''simple docstring'''
from cva import destroyAllWindows, imread, imshow, waitKey


def   lowercase_	(   lowerCAmelCase__	:  str			,							lowerCAmelCase__	:  int ):

			"""simple docstring"""





			__UpperCAmelCase				,  __UpperCAmelCase   :      Dict										=     img.shape[0], img.shape[1]

			def to_grayscale(lowerCAmelCase__	:  int			,							lowerCAmelCase__	:  Tuple			,							lowerCAmelCase__	:  Any ):
						return 0.2_126 * red + 0.587 * green + 0.114 * blue

			def normalize(lowerCAmelCase__	:  Union[str, Any] ):
						return min(lowerCAmelCase__			,							255 )

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

			return img


if __name__ == "__main__":
					# read original image
					_UpperCamelCase											=			{
					    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()









'''simple docstring'''
from math import pi


def   lowercase_	(   lowerCAmelCase__	:  float ):

			"""simple docstring"""





			return degree / (180 / pi)


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

					testmod()




