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 sys
|
|
|
|
|
2015-09-06 21:34:26 +00:00
|
|
|
img = BMPFile()
|
|
|
|
img.parse( sys.argv[1] );
|
2015-09-06 12:54:58 +00:00
|
|
|
|
2015-09-07 08:11:04 +00:00
|
|
|
|
2015-09-06 21:34:26 +00:00
|
|
|
### print header human-readable data ###
|
2015-09-07 08:11:04 +00:00
|
|
|
print img.header.info()
|
2015-09-06 21:34:26 +00:00
|
|
|
|
2015-09-07 08:11:04 +00:00
|
|
|
print
|
|
|
|
print img.content.readableData
|
|
|
|
print
|
2015-09-06 21:34:26 +00:00
|
|
|
### print file human-readable data ###
|
|
|
|
#print img.readableData
|
|
|
|
|
|
|
|
### print header human-readable data ###
|
|
|
|
#print img.header.readableData
|
|
|
|
|
|
|
|
### print content human-readable data ###
|
|
|
|
#print img.content.readableData
|
2015-09-06 18:41:55 +00:00
|
|
|
|
2015-09-06 14:01:17 +00:00
|
|
|
|
2015-09-06 20:43:37 +00:00
|
|
|
for line in img.content.map:
|
2015-09-06 15:55:47 +00:00
|
|
|
for pixel in line:
|
2015-09-06 16:35:58 +00:00
|
|
|
print "rgb(%s, %s, %s)" % (pixel.r, pixel.g, pixel.b)
|
2015-09-06 20:43:37 +00:00
|
|
|
print
|