denoising.py/code/bmp.py

24 lines
394 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
2015-09-06 14:02:28 +00:00
fileData = ""
2015-09-06 12:54:58 +00:00
with open(sys.argv[1]) as f:
for byte in f.read():
2015-09-06 14:02:28 +00:00
fileData += byte
2015-09-06 12:54:58 +00:00
2015-09-06 14:01:17 +00:00
headerSize = 54
2015-09-06 14:02:28 +00:00
header = BMPHeader( fileData[0:headerSize] )
content = fileData[headerSize:]
2015-09-06 12:54:58 +00:00
2015-09-06 14:01:17 +00:00
print header.offset
2015-09-06 12:54:58 +00:00
print
print content