9951 explained code solutions for 126 technologies


python-pillowHow to change image brightness


from PIL import Image, ImageEnhance

im = Image.open('/var/www/examples/heroine.png')
im = ImageEnhance.Brightness(im).enhance(2)

im.show()ctrl + c
PIL

import Pillow package modules

Image.open

open given image with Pillow

ImageEnhance.Brightness

brightness management utility

enhance

changes respective enhance option (brightness in our case)

2

increases brightness by 2 times

.show()

displays resulting image