Created
March 4, 2014 21:01
-
-
Save robinhouston/9355549 to your computer and use it in GitHub Desktop.
A 4096×4096 image containing each RGB value once (h/t allrgb.com). Z-order traversal of RGB cube mapped to z-order traversal of 4096×4096 square.
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
from PIL import Image | |
def splitnum(k, x): | |
parts = [0] * k | |
for n in range(24): | |
parts[n % k] |= ((x >> n) & 1) << (n // k) | |
return tuple(parts) | |
im = Image.new("RGB", (4096, 4096)) | |
pix = im.load() | |
for n in range(2**24): | |
pix[splitnum(2, n)] = splitnum(3, n) | |
im.save("the-universal-tartan.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment