Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/assets/arcb30_assets_maker/blur.py

15 lines
No EOL
471 B
Python

from PIL import Image, ImageFilter, ImageEnhance
import os
path = os.path.abspath('./output')
files = os.listdir(path)
for file in files:
img = Image.open(f'{path}/{file}')
img2 = img.filter(ImageFilter.GaussianBlur(radius=2))
downlight = ImageEnhance.Brightness(img2)
d2 = downlight.enhance(0.65)
outputpath = os.path.abspath('./bluroutput')
if not os.path.exists(outputpath):
os.makedirs(outputpath)
d2.save(f'{outputpath}/{file}')