am.ba.ko.
am.ba.ko.

Reputation: 1

Change image clarity in Python like Microsoft photo

I want to make a filter to change the clarity of the image, but no matter what I searched, I could not find any function or algorithm for this.

screenshot

Upvotes: 0

Views: 335

Answers (1)

Jamiu S.
Jamiu S.

Reputation: 5721

In your terminal, execute this command: pip install Pillow

from PIL import Image, ImageEnhance

# Read the image
img = Image.open("your-image-path-here.png")

# Image brightness enhancer
enhancer = ImageEnhance.Brightness(img)

factor = 1.3 # Change the value here to change the brightness
img_output = enhancer.enhance(factor)
img_output.save('my-modified-image.png') # You can name "my-modified-image" whatever you want.

Upvotes: 0

Related Questions