


"""simple docstring"""







import warnings

from ...utils import logging
from .image_processing_dpt import DPTImageProcessor


a__							:				int          =	logging.get_logger(__name__)




class 					UpperCamelCase_      (					_a):

	"""simple docstring"""





	def __init__(					self     :							Optional[int]     ,     *UpperCAmelCase__     :							str     ,     **UpperCAmelCase__     :							Any  )			->      Any:
						warnings.warn(
						    "The class DPTFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please"
						    " use DPTImageProcessor instead."     ,     A_     ,     )
						super().__init__(*A_     ,     **A_  )




"""simple docstring"""

from PIL import Image


def lowerCAmelCase_   (					UpperCamelCase__						:			Image					, UpperCamelCase__						:			int			):






 """simple docstring"""







 __lowercase						=						(259 * (level + 255)) / (255 * (259 - level))

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

 return img.point(UpperCamelCase__			)


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