denoising.py/code/bmp.py

24 lines
434 B
Python
Raw Normal View History

2015-09-06 12:54:58 +00:00
# ~*~ encoding: utf-8 ~*~ #
###########################
# TRAITEMENT D'IMAGES #
###########################
import dep
import sys
tmp = ""
header = ""
content = ""
with open(sys.argv[1]) as f:
for byte in f.read():
tmp += str( hex( ord(byte) ) )[2:] + ","
2015-09-06 13:01:55 +00:00
headerSize = ( 2 + 4 + 2 + 2 + 4 + 4 + 4 + 4 + 2 + 2 + 4 + 4 + 4 + 4 + 4 + 4 )
2015-09-06 12:54:58 +00:00
header = tmp[:headerSize]
content = tmp[headerSize:]
print header
print
print content