code: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  
  
  
  def      _lowerCAmelCase		(		lowercase      ,			lowercase      ,			lowercase			)      ->      list[int]:
  			if hue < 0 or hue > 360:
  						raise Exception("""hue should be between 0 and 360"""			)
  
  			if saturation < 0 or saturation > 1:
  						raise Exception("""saturation should be between 0 and 1"""			)
  
  			if value < 0 or value > 1:
  						raise Exception("""value should be between 0 and 1"""			)
  
  			__lowerCAmelCase      		=       value * saturation
  			__lowerCAmelCase      		=       hue / 60
  			__lowerCAmelCase      		=       chroma * (1 - abs(hue_section % 2 - 1			))
  			__lowerCAmelCase      		=       value - chroma
  
  			if hue_section >= 0 and hue_section <= 1:
  						__lowerCAmelCase      		=       round(255 * (chroma + match_value)			)
  						__lowerCAmelCase      		=       round(255 * (second_largest_component + match_value)			)
  						__lowerCAmelCase      		=       round(255 * (match_value)			)
  			elif hue_section > 1 and hue_section <= 2:
  						__lowerCAmelCase      		=       round(255 * (second_largest_component + match_value)			)
  						__lowerCAmelCase      		=       round(255 * (chroma + match_value)			)
  						__lowerCAmelCase      		=       round(255 * (match_value)			)
  			elif hue_section > 2 and hue_section <= 3:
  						__lowerCAmelCase      		=       round(255 * (match_value)			)
  						__lowerCAmelCase      		=       round(255 * (chroma + match_value)			)
  						__lowerCAmelCase      		=       round(255 * (second_largest_component + match_value)			)
  			elif hue_section > 3 and hue_section <= 4:
  						__lowerCAmelCase      		=       round(255 * (match_value)			)
  						__lowerCAmelCase      		=       round(255 * (second_largest_component + match_value)			)
  						__lowerCAmelCase      		=       round(255 * (chroma + match_value)			)
  			elif hue_section > 4 and hue_section <= 5:
  						__lowerCAmelCase      		=       round(255 * (second_largest_component + match_value)			)
  						__lowerCAmelCase      		=       round(255 * (match_value)			)
  						__lowerCAmelCase      		=       round(255 * (chroma + match_value)			)
  			else:
  						__lowerCAmelCase      		=       round(255 * (chroma + match_value)			)
  						__lowerCAmelCase      		=       round(255 * (match_value)			)
  						__lowerCAmelCase      		=       round(255 * (second_largest_component + match_value)			)
  
  			return [red, green, blue]
  
  
  
  
  
  def      _lowerCAmelCase		(		lowercase      ,			lowercase      ,			lowercase			)      ->      list[float]:
  			if red < 0 or red > 255:
  						raise Exception("""red should be between 0 and 255"""			)
  
  			if green < 0 or green > 255:
  						raise Exception("""green should be between 0 and 255"""			)
  
  			if blue < 0 or blue > 255:
  						raise Exception("""blue should be between 0 and 255"""			)
  
  			__lowerCAmelCase      		=       red / 255
  			__lowerCAmelCase      		=       green / 255
  			__lowerCAmelCase      		=       blue / 255
  			__lowerCAmelCase      		=       max(lowercase      ,			lowercase      ,			lowercase			)
  			__lowerCAmelCase      		=       value - min(lowercase      ,			lowercase      ,			lowercase			)
  			__lowerCAmelCase      		=       0 if value == 0 else chroma / value
  
  			if chroma == 0:
  						__lowerCAmelCase      		=       0.0
  			elif value == float_red:
  						__lowerCAmelCase      		=       60 * (0 + (float_green - float_blue) / chroma)
  			elif value == float_green:
  						__lowerCAmelCase      		=       60 * (2 + (float_blue - float_red) / chroma)
  			else:
  						__lowerCAmelCase      		=       60 * (4 + (float_red - float_green) / chroma)
  
  			__lowerCAmelCase      		=       (hue + 360) % 360
  
  			return [hue, saturation, value]
  
  
  
  
  
  
  
  def      _lowerCAmelCase		(		lowercase      ,			lowercase			)      ->      bool:
  			__lowerCAmelCase      		=       abs(hsv_a[0] - hsv_a[0]			) < 0.2
  			__lowerCAmelCase      		=       abs(hsv_a[1] - hsv_a[1]			) < 0.0_02
  			__lowerCAmelCase      		=       abs(hsv_a[2] - hsv_a[2]			) < 0.0_02
  
  			return check_hue and check_saturation and check_value
  
  
style_context: 
  
  
  
  
  
  '''simple docstring'''
  
  
  
  
  
  
  
  from cva import destroyAllWindows, imread, imshow, waitKey
  
  
  
  
  
  def      _lowerCAmelCase		(		lowercase      ,			lowercase			)      ->      int:
  			__lowerCAmelCase		, __lowerCAmelCase      		=       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			):
  									__lowerCAmelCase      		=       int(to_grayscale(*img[i][j]			)			)
  									__lowerCAmelCase      		=       [
  									    normalize(lowercase			),
  									    normalize(greyscale + factor			),
  									    normalize(greyscale + 2 * factor			),
  									]
  
  			return img
  
  
  if __name__ == "__main__":
  	# read original image
  	_a      :				Any											=					{
  	    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()
  
  