Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- import sys
- if len(sys.argv) != 2:
- print "Usage: solvesteg.py filename"
- exit(1)
- img = Image.open(sys.argv[1], "r")
- pix = img.load()
- width = img.size[0]
- height = img.size[1]
- new_img = Image.new("L", (width, height))
- new_pix = new_img.load()
- for x in range(width):
- for y in range(height):
- p = pix[x, y]
- hidden_pix = ((p[0] & 1) << 3) | ((p[1] & 1) << 2) | ((p[2] & 1) << 1) | p[3] & 1
- new_pix[x, y] = hidden_pix * 16
- new_img.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement