denoising.py/code/bmp.py

24 lines
437 B
Python

# ~*~ encoding: utf-8 ~*~ #
###########################
# TRAITEMENT D'IMAGES #
###########################
# classes
from classes import *
import dep
import sys
fileData = ""
with open(sys.argv[1]) as f:
for byte in f.read():
fileData += byte
headerSize = 54
header = BMPHeader( fileData[:headerSize] )
content = BMPContent( fileData[header.offset:], header.width, header.bpp)
print header.bpp
print
print content.map