denoising.py/code/bmp.py

24 lines
420 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
2015-09-06 14:28:56 +00:00
from classes import *
2015-09-06 14:01:17 +00:00
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:28:56 +00:00
header = BMPHeader( fileData[:headerSize] )
2015-09-06 15:05:52 +00:00
content = BMPContent( fileData[header.offset:], header )
2015-09-06 12:54:58 +00:00
2015-09-06 14:28:56 +00:00
print header.bpp
2015-09-06 12:54:58 +00:00
print
2015-09-06 14:28:56 +00:00
print content.map