Skip to content

Instantly share code, notes, and snippets.

@jeremyBanks
Created August 11, 2008 07:16
Show Gist options
  • Save jeremyBanks/4821 to your computer and use it in GitHub Desktop.
Save jeremyBanks/4821 to your computer and use it in GitHub Desktop.
[2010-01] I thought I saw the script that generated my avatar in a more recent post...
#!/usr/bin/env python
import Image
rows = (0x18, 0x24, 0x7E, 0x81, 0x42, 0xE7)
image = Image.new("RGB", (8, 8), (255, 255, 255))
pixels = image.load()
for y in range(len(rows)):
for x in range(8):
pixels[x, y + 1] = (0, 0, 0) if (rows[y] >> x) & 1 else (255, 255, 255)
del pixels
image = image.resize((400, 400), Image.NEAREST)
image.save("av.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment