Legofy is a python program that takes a static image or a gif and converts it to an image to look like it was built out of LEGO 1x1 pieces.
- Python
- Python modules: Pillow, click # pip will install these automatically if using
pip install legofy
- imagemagick # not needed but recommended
If you find a bug:
- Check in the open issues if the bug already exists.
- If the bug is not there, create a new issue with clear steps on how to reproduce it.
$ pip install legofy
or install from this source
$ git clone https://github.com/richiehug/Legofy.git
$ cd Legofy
$ python setup.py install
Usage: legofy [OPTIONS] IMAGE [OUTPUT]
Legofy an image!
Options:
--size INTEGER Number of LEGO bricks the longest side of the legofied image should have.
--dither / --no-dither Choose whether the dither algorithm should be used to spread the color approximation error.
--palette [all|solid|special|mono|transparent]
Choose if a specific LEGO color palette should be used.
--highres / --nohighres Use highres to enhance the final output by using a larger base lego picture (200px vs 30px).
--resize INTEGER Resize the image to max width & max length while keeping its ratio.
--help Show this message and exit.
There are 4 palettes: solid (45 colors), special (8 colors), mono (2 colors) and transparent (14 colors). You can use a specific one or all 4.
$ legofy --palette solid image.jpg
$ legofy --palette transparent image.jpg
$ legofy --palette effects image.jpg
$ legofy --palette all image.jpg
- Download and install all requirements
- python from the official python website
- imagemagick from the official imagemagick website
- Download this project by using the download zip button on this page, or running
git clone https://github.com/richiehug/Legofy
- If you downloaded a zip file, please unzip it
- Open a command line and navigate to the project folder
- Run
python setup.py install
while in the project folder - You can now use Legofy anywhere, see usage for more help
- JavaScript: Legofy