




'''simple docstring'''







from PIL import Image





def 						snake_case_							(_a	:							Image    ,   _a	:							int     ):
    UpperCAmelCase			       =		(2_5_9 * (level + 2_5_5)) / (2_5_5 * (2_5_9 - level))

    def contrast(_a	:							int     ) -> int:
        return int(1_2_8 + factor * (c - 1_2_8)     )

    return img.point(_a     )


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










'''simple docstring'''







from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
   A     =input('Enter image url: ').strip()
   print(f"""Downloading image from {url} ...""")
   A     =BeautifulSoup(requests.get(url).content, 'html.parser')
   # The image URL is in the content field of the first meta tag with property og:image
   A     =soup.find('meta', {'property': 'og:image'})['content']
   A     =requests.get(image_url).content
   A     =f"""{datetime.now():%Y-%m-%d_%H:%M:%S}.jpg"""
   with open(file_name, 'wb') as fp:
      fp.write(image_data)
   print(f"""Done. Image saved to disk as {file_name}.""")




