Last active
August 16, 2018 18:35
-
-
Save yoya/8670e7dd2c91b9bf59dd90ecd19eb323 to your computer and use it in GitHub Desktop.
pil_imageops_equalize.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageOps | |
import sys | |
im = Image.open(sys.argv[1]) | |
im = im.convert("YCbCr") | |
yy, cb, cr = im.split() | |
yy = ImageOps.equalize(yy); | |
im = Image.merge("YCbCr", (yy, cb, cr)) | |
im = im.convert("RGB") | |
im.show() | |
# im.save(sys.argv[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment