Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
/ Magickly Public archive

Magickly is an image processing library for PHP.

License

Notifications You must be signed in to change notification settings

GravityMedia/Magickly

Repository files navigation

Magickly

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads Dependency Status

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.

About

Magickly is an image processing library for PHP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages