Automate GIMP best brightness and contrast to ease visualization? #52

Open
opened 2024-04-18 00:15:21 +02:00 by Benjamin_Loison · 1 comment

Just being able to code brightness and contrast change would ease treating multiple images as it is required in #49.

0cad346fc9/src/PIL/ImageEnhance.py (L75-L81)

0cad346fc9/src/PIL/ImageEnhance.py (L58-L64)

from PIL import Image, ImageEnhance

img = Image.open('photo_benjamin_loison.jpg')
# enhancer = ImageEnhance.Contrast(img)
enhancer = ImageEnhance.Brightness(img)
# to reduce brightness by 50%, use factor 0.5
img = enhancer.enhance(0.5)

img.show()

Source: the Stack Overflow answer 67028021.

Just being able to code brightness and contrast change would ease treating multiple images as it is required in #49. https://github.com/python-pillow/Pillow/blob/0cad346fc960bc07cde9d1d9135421978e2f28e8/src/PIL/ImageEnhance.py#L75-L81 https://github.com/python-pillow/Pillow/blob/0cad346fc960bc07cde9d1d9135421978e2f28e8/src/PIL/ImageEnhance.py#L58-L64 ```python from PIL import Image, ImageEnhance img = Image.open('photo_benjamin_loison.jpg') # enhancer = ImageEnhance.Contrast(img) enhancer = ImageEnhance.Brightness(img) # to reduce brightness by 50%, use factor 0.5 img = enhancer.enhance(0.5) img.show() ``` Source: [the Stack Overflow answer 67028021](https://stackoverflow.com/a/67028021).
Benjamin_Loison added the
enhancement
low priority
quick
labels 2024-04-18 00:15:28 +02:00
Author
Owner

If the images are normalized, despite inner bounds different distributions have same contrast modification, right?

If the images are normalized, despite inner bounds different distributions have same contrast modification, right?
Sign in to join this conversation.
No description provided.