Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- """
- alphareveal.py
- A python script to reveal image data in a PNG
- image hidden behind a fully transparent alpha
- channel.
- You are free to do whatever the fuck you want
- to with this file and there is no guarantee
- that it doesn't blow your machine up.
- Usage:
- Save this file in the directory that your image is in as alphareveal.py
- Locate yourself to said directory using the terminal emulator of your choice
- $ python alphareveal.py <FILENAME OF IMAGE YOU WANT TO REVEAL>
- It will then save the image in a separate file.
- """
- from PIL import Image
- import sys
- filepath = sys.argv[1]
- newpath = filepath[:len(filepath)-4] + "_revealed.png"
- temp = Image.open(filepath)
- #fuck your partial alpha channels it's all visible now
- temp.putalpha(255)
- print "Saving revealed image to", newpath
- temp.save(newpath)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement