Created
February 18, 2019 04:28
-
-
Save khajer/7bcb26ef0af3372cfe1e5cd73522de14 to your computer and use it in GitHub Desktop.
reduce alpha image
This file contains hidden or 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 | |
| arImg = [ | |
| "android_128_px.png", | |
| "apache_128_px.png", | |
| "coupon_128_px.png", | |
| "graphs_128_px.png", | |
| "lab_128_px.png", | |
| "rocket_128_px.png", | |
| "twitter_128_px.png", | |
| "video_128_px.png" | |
| ] | |
| def recalcImage(filename): | |
| # print filename | |
| img = Image.open(filename) | |
| img.putalpha(128) # Half alpha; alpha argument must be an int | |
| destfile = filename.split(".")[0]+"_unactive.png" | |
| print destfile | |
| img.save(destfile, "PNG") | |
| def main(): | |
| print 'haha' | |
| for x in arImg: | |
| recalcImage(x) | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment