<commit_before>legofy
======

.. contents::

What is legofy?
---------------

It is a simple python function to convert an image into a a lego-like image. It
started long ago as part of my Python learning.


Usage
-----

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')


Developer information
---------------------

[<NAME>](mailto:<EMAIL>)


License information
-------------------

See the file ``LICENSE`` for information on this software, terms & conditions
for usage and a disclaimer of all warranties.<commit_msg>Fixed typos<commit_after>legofy
======

.. contents::

What is legofy?
---------------

It is a simple python function to convert an image into a a lego-like image. It
started long ago as part of my Python learning.


Usage
-----

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')
```
![Random Image](https://github.com/oliveirarodolfo/legofy/images/rand-lego.png)


  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')
```
![Monalisa Image](https://github.com/oliveirarodolfo/legofy/images/mona-lego.png)

Send a hi!
----------
    <EMAIL>

License information
-------------------

See the file ``LICENSE`` for information on this software, terms & conditions
for usage and a disclaimer of all warranties.

{'fraction_non_alphanumeric': 0.1634920634920635, 'fraction_numerical': 0.015238095238095238, 'mean_word_length': 2.943679599499374, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 120, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2669930', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1035, 'n_words': 267}