In [1]: import Image
In [2]: import binascii
In [3]: png = Image.open('steg.png')
In [4]: pix = png.load()
In [5]: png.size
In [6]: for i in xrange (0,800):
print '%02x%02x%02x' % (pix[i,0][0],pix[i,0][1],pix[i,0][2]),
In [7]: for i in xrange (0,800):
print '%02x%02x%02x' % (pix[i,1][0],pix[i,1][1],pix[i,1][2]),
In [8]: string = ''
In [9]: for i in xrange (0,800):
r,g,b = pix[i,0]
r -= 254
g -= 254
b -= 254
string += str(r) + str(g) + str(b)
In [10]: binascii.unhexlify('%x' % int(string,2))
No comments:
Post a Comment