



"""simple docstring"""






from cva import destroyAllWindows, imread, imshow, waitKey






def 	snake_case__  (						__lowerCamelCase							:       List[Any]				,						__lowerCamelCase							:       int      ):
			"""simple docstring"""
			lowerCamelCase__      ,  lowerCamelCase__						:						Union[str, Any]						      =img.shape[0], img.shape[1]

			def to_grayscale(__lowerCamelCase							:       Union[str, Any]				,						__lowerCamelCase							:       List[str]				,						__lowerCamelCase							:       Optional[Any]      ):
						return 0.21_26 * red + 0.5_87 * green + 0.1_14 * blue

			def normalize(__lowerCamelCase							:       Tuple      ):
						return min(__lowerCamelCase				,						255      )

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

			return img


if __name__ == "__main__":
		# read original image
		_lowercase					:					List[str] 		=		{
		    percentage: imread("image_data/lena.jpg", 1) for percentage in (1_0, 2_0, 3_0, 4_0)
		}

		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'''
import math



def 				lowerCAmelCase__	(       UpperCAmelCase     ):






       """simple docstring"""





       snake_case__					:	Tuple          =					math.log(2    ,       10     ) * number
       snake_case__					:	int          =					round((log_number - int(UpperCAmelCase     ))    ,       15     )

       return difference



def 				lowerCAmelCase__	(       UpperCAmelCase = 67_8910     ):






       """simple docstring"""





       snake_case__					:	str          =					90
       snake_case__					:	Dict          =					0

       snake_case__					:	List[str]          =					math.log(1.2_3    ,       10     )
       snake_case__					:	Optional[Any]          =					math.log(1.2_4    ,       10     )
       snake_case__					:	Any          =					0

       while position < number:
              snake_case__					:	Tuple          =					log_difference(UpperCAmelCase     )

              if difference >= upper_limit:
                     power_iterator += 93

              elif difference < lower_limit:
                     power_iterator += 196

              else:
                     snake_case__					:	Union[str, Any]          =					power_iterator
                     power_iterator += 196
                     position += 1

       return previous_power


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     print(f"""{solution() = }""")




