diff --git a/README.md b/README.md index 20f89d1..27a9c08 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,2 @@ # bmp_python Traitement d'image bmp en python - -Test pull diff --git a/blue.bmp b/blue.bmp new file mode 100644 index 0000000..0bcd5c5 Binary files /dev/null and b/blue.bmp differ diff --git a/bmp.py b/bmp.py new file mode 100644 index 0000000..6251926 --- /dev/null +++ b/bmp.py @@ -0,0 +1,24 @@ +# ~*~ encoding: utf-8 ~*~ # +########################### +# TRAITEMENT D'IMAGES # +########################### + +import dep +import sys + +tmp = "" +header = "" +content = "" + + +with open(sys.argv[1]) as f: + for byte in f.read(): + tmp += str( hex( ord(byte) ) )[2:] + "," + +headerSize = ( 14 + 9 ) * 8 +header = tmp[:headerSize] +content = tmp[headerSize:] + +print header +print +print content \ No newline at end of file diff --git a/dep.py b/dep.py new file mode 100644 index 0000000..2ac2fe0 --- /dev/null +++ b/dep.py @@ -0,0 +1,3 @@ +# ~*~ encoding: utf-8 ~*~ # +########################### + diff --git a/dep.pyc b/dep.pyc new file mode 100644 index 0000000..434ba36 Binary files /dev/null and b/dep.pyc differ diff --git a/green.bmp b/green.bmp new file mode 100644 index 0000000..48536de Binary files /dev/null and b/green.bmp differ diff --git a/red.bmp b/red.bmp new file mode 100644 index 0000000..5d25b0a Binary files /dev/null and b/red.bmp differ diff --git a/test.bmp b/test.bmp new file mode 100644 index 0000000..0b2fe5d Binary files /dev/null and b/test.bmp differ