Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ricardofiorani/php-legofy
- Owner: ricardofiorani
- Created: 2016-07-20T01:52:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T20:18:12.000Z (over 3 years ago)
- Last Synced: 2024-11-15T20:27:29.680Z (1 day ago)
- Topics: gd, image-manipulation, image-processing, imagemagick, lego, php, php7
- Language: PHP
- Homepage:
- Size: 5.83 MB
- Stars: 167
- Watchers: 8
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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/LegofyBasically 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)