A PHP image manipulation library built around GD
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
src
test
util
.codeclimate.yml
.gitignore
.travis.yml
LICENSE
README.md
composer.json
phpdoc.xml
phpunit.xml

README.md

Chameleon Build Status Code Climate Test Coverage

Chameleon is a PHP image manipulation library built around GD.

Please note that it is still in development!

Code example

<?php
    require __DIR__ . "/vendor/autoload.php";

    use Chameleon\Image;
    use Chameleon\Vector2;

    use Chameleon\Colors\HSLColor;
    use Chameleon\Primitives\Rectangle;
    use Chameleon\Patterns\BackgroundColor;

    $image = Image::create(480, 360);

    $imageBackground = new HSLColor(135, 1, 0.3);

    $image -> setBackgroundPattern(new BackgroundColor($imageBackground));

    $rectanglePosition = new Vector2(50, 50);
    $rectangleBackground = new HSLColor(45, 1, 0.5);
    $rectangleBorder = new HSLColor(90, 1, 0.8);

    $rectangle = new Rectangle($rectanglePosition, 380, 260);
    $rectangle -> setBackgroundPattern(new BackgroundColor($rectangleBackground))
               -> setBorderPattern(new BackgroundColor($rectangleBorder))
               -> setBorderThickness(5);

    $image -> draw($rectangle);

    header("Content-type: image/png");
    $image -> outputFile(IMG_PNG);
?>

Output

PHP Output