brigthen
A little Python script to brighten an image.
import os
from PIL import ImageEnhance, Image
def brightenImage(input_dir, output_dir):
os.makedirs(output_dir, exist_ok=True) # output directory
for filename in os.listdir(input_dir): # loop through files
if filename.lower().endswith('.jpg'): # check if jpg
with Image.open(os.path.join(input_dir, filename)) as img: # open jpg
enhanced_img = ImageEnhance.Contrast(img).enhance(1.25) # enhance contrast
enhanced_img = ImageEnhance.Brightness(enhanced_img).enhance(1.5) # enhance brightness
enhanced_img.save(os.path.join(output_dir, filename)) # save output
if __name__ == '__main__':
input_directory = '.' # input directory
output_directory = 'output' # output directory
brightenImage(input_directory, output_directory) # brighten image