Magickly is an image processing library for PHP.
This library has the following requirements:
- PHP 5.6+
Install Composer in your project:
$ curl -s https://getcomposer.org/installer | php
Add the package to your composer.json
and install it via Composer:
$ php composer.phar require gravitymedia/magickly
This simple example is showing how to convert an image to RGB color space.
// Initialize autoloader
require_once __DIR__ . '/vendor/autoload.php';
// Import classes
//use GravityMedia\Magickly\Gmagick\Magickly;
use GravityMedia\Magickly\Imagick\Magickly;
use GravityMedia\Magickly\Image\Palette;
// Create Magickly object
$magickly = new Magickly();
// Open image
$image = $magickly->open('/path/to/image/file.png');
// Create RGB palette
$palette = new Palette\RGB();
// Apply RGB palette to image
$image = $image->withPalette($palette);
// Get image data as stream
$stream = $image->getStream();
// Save image as a copy
file_put_contents('/path/to/image/copy.png', $stream->getContents());
Clone this repository, install Composer and all dependencies:
$ php composer.phar install
Run the test suite:
$ php composer.phar test
Clone this repository, install Composer and all dependencies:
$ php composer.phar install
Generate the documentation to the build/docs
directory:
$ php composer.phar doc
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.