denoising.py/code/bmp.py

28 lines
438 B
Python
Raw Normal View History

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