Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ricardofiorani/php-legofy

Transform your images as if they were made out of LEGO bricks.
https://github.com/ricardofiorani/php-legofy

gd image-manipulation image-processing imagemagick lego php php7

Last synced: about 9 hours ago
JSON representation

Transform your images as if they were made out of LEGO bricks.

Awesome Lists containing this project

README

        

# PHP Legofy
[![Build Status](https://api.travis-ci.org/ricardofiorani/php-legofy.svg?branch=master)](http://travis-ci.org/ricardofiorani/php-legofy)
[![Minimum PHP Version](https://img.shields.io/packagist/php-v/ricardofiorani/php-legofy.svg)](https://php.net/)
[![License](https://poser.pugx.org/ricardofiorani/php-legofy/license.png)](https://packagist.org/packages/ricardofiorani/php-legofy)
[![Total Downloads](https://poser.pugx.org/ricardofiorani/php-legofy/d/total.png)](https://packagist.org/packages/ricardofiorani/php-legofy)
[![Coding Standards](https://img.shields.io/badge/cs-PSR--4-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards)

### What is this ?
PHP Legofy is a PHP package that takes a static image and makes it so that it looks as if it was built out of LEGO.
It was inspired by the original Legofy made in Python https://github.com/JuanPotato/Legofy

Basically it transforms this:
![Image of a beer][beer]
Into this:
![Image of a legofied beer][lego-beer]

[beer]: ./assets/examples/beer.jpg
[lego-beer]: ./assets/examples/lego-beer.jpeg

### Requirements
* PHP ^7.1 || ^8.0
* GD or ImageMagick
> I tested it with GD only but I'm trusting intervention/image that this will work on ImageMagick as well.

### Quickstart
Via composer:
```bash
$ composer require ricardofiorani/php-legofy
```

Via source:
```bash
$ git clone [email protected]:ricardofiorani/php-legofy.git
$ cd php-legofy
$ composer install
```

### Usage:
```php
convertToLego($source, $resolutionMultiplier, $useLegoPalette);

// Please see http://image.intervention.io/use/basics and http://image.intervention.io/use/http
echo $output->response();
```

For more examples of usage please see [the usage examples on documentation](https://github.com/ricardofiorani/php-legofy/blob/master/docs/EXAMPLES.md)