Advertisement
Guest User

alphareveal.py

a guest
Jun 8th, 2015
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. """
  4. alphareveal.py
  5.  
  6. A python script to reveal image data in a PNG
  7. image hidden behind a fully transparent alpha
  8. channel.
  9.  
  10. You are free to do whatever the fuck you want
  11. to with this file and there is no guarantee
  12. that it doesn't blow your machine up.
  13.  
  14. Usage:
  15. Save this file in the directory that your image is in as alphareveal.py
  16. Locate yourself to said directory using the terminal emulator of your choice
  17. $ python alphareveal.py <FILENAME OF IMAGE YOU WANT TO REVEAL>
  18.  
  19. It will then save the image in a separate file.
  20. """
  21.  
  22. from PIL import Image
  23. import sys
  24.  
  25. filepath = sys.argv[1]
  26. newpath = filepath[:len(filepath)-4] + "_revealed.png"
  27.  
  28. temp = Image.open(filepath)
  29. #fuck your partial alpha channels it's all visible now
  30. temp.putalpha(255)
  31.  
  32. print "Saving revealed image to", newpath
  33. temp.save(newpath)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement