Commits

Trammell Hudson  committed c5ac30d Draft

Adam's hex2png

  • Participants
  • Parent commits 1192504

Comments (0)

Files changed (1)

+#!/usr/bin/python
+import sys
+import Image
+
+buf = sys.stdin.read()
+
+# rearrange buf into parallel columns
+bw=8*6
+cols=128
+w=bw*cols
+h=256*256/cols
+img = Image.new("1",(w,h))
+
+for c in range(cols):
+    colimg = Image.fromstring("1",(bw,h),buf[c*h:(c+int(bw/8))*h])
+    img.paste(colimg,(bw*c,0))
+
+img.save(sys.argv[1])