gravitymedia / magickly
This package is abandoned and no longer maintained.
No replacement package was suggested.
Magickly is an image processing library for PHP.
dev-master / 1.0.x-dev
2016-09-22 19:21 UTC
Requires
- php: >=5.6
- guzzlehttp/streams: ^3.0
Requires (Dev)
- phing/phing: ^2.15
- phpunit/phpunit: ^5.5
- sami/sami: ^3.3
- scrutinizer/ocular: ^1.3
- symfony/finder: ^2.8
Suggests
- ext-gmagick: to use the Gmagick implementation
- ext-imagick: to use the Imagick implementation
This package is auto-updated.
Last update: 2023-03-27 01:13:01 UTC
README
Magickly is an image processing library for PHP.
Requirements
This library has the following requirements:
- PHP 5.6+
Installation
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
Usage
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());
Testing
Clone this repository, install Composer and all dependencies:
$ php composer.phar install
Run the test suite:
$ php composer.phar test
Generating documentation
Clone this repository, install Composer and all dependencies:
$ php composer.phar install
Generate the documentation to the build/docs
directory:
$ php composer.phar doc
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.