

class 				UpperCAmelCase_		:  # Public class to implement a graph
							"""simple docstring"""







							def __init__(			self       ,							_a       ,							_a       ,							_a       )    ->    None:
												_a	:    int         =		row
												_a	:    List[str]         =		col
												_a	:    Tuple         =		graph


							def 				__lowercase				(			self       ,							_a       ,							_a       ,							_a       )    ->    bool:
												return (
												    0 <= i < self.ROW
												    and 0 <= j < self.COL
												    and not visited[i][j]
												    and self.graph[i][j]
												)


							def 				__lowercase				(			self       ,							_a       ,							_a       ,							_a       )    ->    None:
												# Checking all 8 elements surrounding nth element
												_a	:    List[Any]         =		[-1, -1, -1, 0, 0, 1, 1, 1]  # Coordinate order
												_a	:    str         =		[-1, 0, 1, -1, 1, -1, 0, 1]
												_a	:    Any         =		True  # Make those cells visited
												for k in range(8       ):
																	if self.is_safe(i + row_nbr[k]       ,							j + col_nbr[k]       ,							_a       ):
																						self.diffs(i + row_nbr[k]       ,							j + col_nbr[k]       ,							_a       )




							def 				__lowercase				(			self       )    ->    int:  # And finally, count all islands.
												_a	:    int         =		[[False for j in range(self.COL       )] for i in range(self.ROW       )]
												_a	:    str         =		0
												for i in range(self.ROW       ):
																	for j in range(self.COL       ):
																						if visited[i][j] is False and self.graph[i][j] == 1:
																											self.diffs(_a       ,							_a       ,							_a       )
																											count += 1
												return count





from PIL import Image




def 	_SCREAMING_SNAKE_CASE					(		_lowerCamelCase :			Image						,  _lowerCamelCase :			int)					->    Image:






							'''simple docstring'''





							__UpperCamelCase	:   str			   =					(259 * (level + 255)) / (255 * (259 - level))

							def contrast(_lowerCamelCase :			int) -> int:
														return int(128 + factor * (c - 128))

							return img.point(_lowerCamelCase)


if __name__ == "__main__":
		# Load image
		with Image.open('image_data/lena.jpg') as img:
				# Change contrast to 170
				lowercase  :					Tuple													=       change_contrast(img, 170)
				cont_img.save('image_data/lena_high_contrast.png', format='png')