It's a simple python function to convert an image into a a lego-like image. It started long ago as a practical exercise to learn some simple Python functionality (e.g. PyPI packaging) but it's now retired in favor of JuanPotato's Legofy.
A simple example can be generated by using an array with random values:
import numpy
from legofy import legofy
from matplotlib import pyplot
im = numpy.random.rand(10, 10)
im_lego = legofy(im)
_ = pyplot.imshow(im_lego, interpolation='none', origin='lower')
But I want to do it with my profile picture, how can I do it?!
import scipy
from legofy import legofy
from matplotlib import pyplot
import urllib
import cStringIO
url = 'http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/161px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg'
im = misc.imread(cStringIO.StringIO(urllib.urlopen(url).read()))
im = misc.imresize(im, (50, 33), interp='nearest')
im = 1-(255-im)/(255)
im_lego = legofy(im)
_ = pyplot.imshow(im_lego, interpolation='none', origin='lower')
See the file LICENSE for information on this software, terms & conditions for usage and a disclaimer of all warranties.