GithubHelp home page GithubHelp logo

ricardofiorani / php-legofy Goto Github PK

View Code? Open in Web Editor NEW
166.0 8.0 11.0 5.97 MB

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

PHP 100.00%
lego php php7 image-processing image-manipulation gd imagemagick

php-legofy's Introduction

PHP Legofy

Build Status Minimum PHP Version License Total Downloads Coding 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 Into this: Image of a legofied beer

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:

$ composer require ricardofiorani/php-legofy

Via source:

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

Usage:

<?php
require 'vendor/autoload.php';

// The multiplier for the amount of legos on your image, or "legolution" :)
$resolutionMultiplier = 1;

// When set to true it will only use lego colors that exists in real world.
$useLegoPalette = false;

$legofy = new \RicardoFiorani\Legofy\Legofy();

// $source can be any acceptable parameter for intervention/image
// Please see http://image.intervention.io/api/make
$source = 'my/imagem/path/image.jpg';

/**
 *@var Intervention\Image\Image 
 */
$output = $legofy->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

php-legofy's People

Contributors

dependabot-preview[bot] avatar mrchozo avatar ricardofiorani avatar samnela avatar willemstuursma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-legofy's Issues

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.