Black-and-white images using every colour
February 2010 (index)
The allRGB website sets the challenge of making a 4,096x4,096 pixel image that uses every one of the 16,777,216 RGB colours once and only once.
My response is a version of the classic computer science test image Lenna.
It works using the Python imaging library (PIL). First read in a grayscale photo and make a list of the pixels in ascending order of brightness (whiteness). Then make a list of all the RGB colours in ascending order of brightness (R+G+B). Then match them up so the brightest RGB colours correspond to the brightest pixels of the original image.
The tricky bit was being able to access all 16,777,216 pixels in order of brightness. The first time I tried crashed my computer. In the end I used a generator function, which avoids having to keep a massive list in memory.
The Python code is here.
ibbly.com contact