A python function to convert an image into a lego-like image.