Created
September 11, 2008 02:34
-
-
Save jeremyBanks/10148 to your computer and use it in GitHub Desktop.
[2010-01] oh ha, this is the script I used to generate the old avatar/logo, the one of my contact card
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
import Image | |
generations = [ | |
0x18, | |
0x24, | |
0x7E, | |
0x81, | |
0x42, | |
0xE7 | |
] | |
alive = (0, 0, 0, 255) | |
dead = (255, 255, 255, 0) | |
scale = 250 | |
def main(): | |
dimensions = width, height = 8, len(generations) | |
image = Image.new("RGBA", dimensions, dead) | |
pixels = image.load() | |
for y in xrange(len(generations)): | |
for x in xrange(8): | |
pixels[x, y] = alive if ((generations[y] >> x) & 1) else dead | |
image = image.resize(tuple(scale * u for u in dimensions), Image.NEAREST) | |
image.save("/Users/jeremybanks/Desktop/logo.png") | |
if __name__ == "__main__": main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment