Git Product home page Git Product logo

legofy's Introduction

Legofy Build Status PyPI Downloads PyPI version License Coverage Status Code Health Join the chat at https://gitter.im/JuanPotato/Legofy

What is it?

Legofy is a python program that takes a static image or gif and makes it so that it looks as if it was built out of LEGO.

Before

After

Requirements

  • Python
  • Python modules: Pillow, click # pip will install these automatically if using pip install legofy
  • imagemagick # not needed but recommended

Bugs

If you find a bug:

  1. Check in the open issues if the bug already exists.
  2. If the bug is not there, create a new issue with clear steps on how to reproduce it.

Quickstart

$ pip install legofy

or install from source

$ git clone https://github.com/JuanPotato/Legofy.git
$ cd Legofy
$ python setup.py install

Wait! I don't know what any of this means? Use pip then, or if you really want to install from source have some help.

Usage

Usage: legofy [OPTIONS] IMAGE [OUTPUT]

  Legofy an image!

Options:
  --size INTEGER                  Number of bricks the longest side of the legofied image should have.
  --dither / --no-dither          Use dither algorithm to spread the color approximation error.
  --palette [all|effects|mono|solid|transparent]
                                  Palette to use based on real Lego colors.
  --help                          Show this message and exit.

Palette

There are 3 palettes: solid (33 colors), transparent (14 colors) and effects (4 colors). You can use one of them or all the 3.

$ legofy --palette solid image.jpg
$ legofy --palette transparent image.jpg
$ legofy --palette effects image.jpg
$ legofy --palette all image.jpg

There is another one palette, mono, with only 2 colors (black and white...). It's just for test and fun...

Troubleshooting

Installation

  1. Download and install all requirements
  1. Download this project by using the download zip button on this page, or running git clone https://github.com/JuanPotato/Legofy
  • If you downloaded a zip file, please unzip it
  1. Open a command line and navigate to the project folder
  2. Run python setup.py install while in the project folder
  3. You can now use Legofy anywhere, see usage for more help

Forks

legofy's People

Contributors

juanpotato avatar itcave avatar niroyb avatar armel avatar levikanwischer avatar marcoceppi avatar christoga avatar nabijaczleweli avatar livibetter avatar romanpitak avatar jightuse avatar lamby avatar nils-werner avatar taranjeet avatar gitter-badger avatar wildhoney avatar xbluedogx avatar

Watchers

James Cloos avatar Michael Knowles avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.