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 1 year ago
JSON representation
Transform your images as if they were made out of LEGO bricks.
- Host: GitHub
- URL: https://github.com/ricardofiorani/php-legofy
- Owner: ricardofiorani
- Created: 2016-07-20T01:52:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T20:18:12.000Z (about 5 years ago)
- Last Synced: 2025-03-31T17:19:48.273Z (about 1 year ago)
- Topics: gd, image-manipulation, image-processing, imagemagick, lego, php, php7
- Language: PHP
- Homepage:
- Size: 5.83 MB
- Stars: 167
- Watchers: 7
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Legofy
[](http://travis-ci.org/ricardofiorani/php-legofy)
[](https://php.net/)
[](https://packagist.org/packages/ricardofiorani/php-legofy)
[](https://packagist.org/packages/ricardofiorani/php-legofy)
[](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 git@github.com: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)