{"id":20679714,"url":"https://github.com/ricardofiorani/php-legofy","last_synced_at":"2025-04-08T03:10:21.856Z","repository":{"id":52416736,"uuid":"63741349","full_name":"ricardofiorani/php-legofy","owner":"ricardofiorani","description":"Transform your images as if they were made out of LEGO bricks.","archived":false,"fork":false,"pushed_at":"2021-04-29T20:18:12.000Z","size":6109,"stargazers_count":167,"open_issues_count":1,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-31T17:19:48.273Z","etag":null,"topics":["gd","image-manipulation","image-processing","imagemagick","lego","php","php7"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricardofiorani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-20T01:52:26.000Z","updated_at":"2024-10-11T12:00:39.000Z","dependencies_parsed_at":"2022-08-24T22:40:22.286Z","dependency_job_id":null,"html_url":"https://github.com/ricardofiorani/php-legofy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardofiorani%2Fphp-legofy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardofiorani%2Fphp-legofy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardofiorani%2Fphp-legofy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardofiorani%2Fphp-legofy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricardofiorani","download_url":"https://codeload.github.com/ricardofiorani/php-legofy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gd","image-manipulation","image-processing","imagemagick","lego","php","php7"],"created_at":"2024-11-16T21:27:15.857Z","updated_at":"2025-04-08T03:10:21.824Z","avatar_url":"https://github.com/ricardofiorani.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Legofy\n[![Build Status](https://api.travis-ci.org/ricardofiorani/php-legofy.svg?branch=master)](http://travis-ci.org/ricardofiorani/php-legofy)\n[![Minimum PHP Version](https://img.shields.io/packagist/php-v/ricardofiorani/php-legofy.svg)](https://php.net/)\n[![License](https://poser.pugx.org/ricardofiorani/php-legofy/license.png)](https://packagist.org/packages/ricardofiorani/php-legofy)\n[![Total Downloads](https://poser.pugx.org/ricardofiorani/php-legofy/d/total.png)](https://packagist.org/packages/ricardofiorani/php-legofy)\n[![Coding Standards](https://img.shields.io/badge/cs-PSR--4-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards)\n\n### What is this ?\nPHP 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.  \nIt was inspired by the original Legofy made in Python https://github.com/JuanPotato/Legofy\n\nBasically it transforms this:\n![Image of a beer][beer]\nInto this:\n![Image of a legofied beer][lego-beer]\n\n[beer]: ./assets/examples/beer.jpg\n[lego-beer]: ./assets/examples/lego-beer.jpeg\n\n### Requirements\n* PHP ^7.1 || ^8.0\n* GD or ImageMagick\n\u003e I tested it with GD only but I'm trusting intervention/image that this will work on ImageMagick as well.\n\n### Quickstart\nVia composer:\n```bash\n$ composer require ricardofiorani/php-legofy\n```\n\nVia source:\n```bash\n$ git clone git@github.com:ricardofiorani/php-legofy.git\n$ cd php-legofy\n$ composer install\n```\n\n### Usage:\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\n// The multiplier for the amount of legos on your image, or \"legolution\" :)\n$resolutionMultiplier = 1;\n\n// When set to true it will only use lego colors that exists in real world.\n$useLegoPalette = false;\n\n$legofy = new \\RicardoFiorani\\Legofy\\Legofy();\n\n// $source can be any acceptable parameter for intervention/image\n// Please see http://image.intervention.io/api/make\n$source = 'my/imagem/path/image.jpg';\n\n/**\n *@var Intervention\\Image\\Image \n */\n$output = $legofy-\u003econvertToLego($source, $resolutionMultiplier, $useLegoPalette);\n\n// Please see http://image.intervention.io/use/basics and http://image.intervention.io/use/http\necho $output-\u003eresponse();\n```\n\nFor more examples of usage please see [the usage examples on documentation](https://github.com/ricardofiorani/php-legofy/blob/master/docs/EXAMPLES.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardofiorani%2Fphp-legofy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricardofiorani%2Fphp-legofy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardofiorani%2Fphp-legofy/lists"}