2017 © Pedro Peláez
 

library imagine

Image processing for PHP 5.3

image

imagine/imagine

Image processing for PHP 5.3

  • Wednesday, July 18, 2018
  • by romain
  • Repository
  • 155 Watchers
  • 3370 Stars
  • 12,277,949 Installations
  • PHP
  • 343 Dependents
  • 23 Suggesters
  • 497 Forks
  • 135 Open issues
  • 28 Versions
  • 6 % Grown

The README.md

Imagine

PHPUnit Coding Style, (*1)

Tweet about it using the #php_imagine hashtag., (*2)

Image manipulation library for PHP inspired by Python's PIL and other image libraries., (*3)

Requirements

The Imagine library has the following requirements:, (*4)

  • PHP 5.5+

Depending on the chosen Image implementation, you may need one of the following PHP extensions:, (*5)

  • GD2
  • Imagick (with ImageMagick version 6.2.9 or later, except version 7.0.7-32)
  • Gmagick

To read EXIF metadata (e.g. for autorotation), activate the PHP exif extension. This is optional: Imagine works without the PHP exif extension, but then it can't read and act on image orientation or other EXIF metadata., (*6)

Installation using composer

php composer.phar require imagine/imagine, (*7)

Basic Principles

The main purpose of Imagine is to provide all the necessary functionality to bring all native low level image processing libraries in PHP to the same simple and intuitive OO API., (*8)

Several things are necessary to accomplish that:, (*9)

  • Image manipulation tools, such as resize, crop, etc.
  • Drawing API - to create basic shapes and advanced charts, write text on the image
  • Masking functionality - ability to apply black&white or grayscale images as masks, leading to semi-transparency or absolute transparency of the image the mask is being applied to

The above tools should be the basic foundation for a more powerful set of tools that are called Filters in Imagine., (*10)

Some of the ideas for upcoming filters:, (*11)

  • Charting and graphing filters - pie and bar charts, linear graphs with annotations
  • Reflection - apple style
  • Rounded corners - web 2.0

Documentation

Presentations

Articles

Contributing

Branches

New pull requests should be based on the develop branch. The master branch is the stable branch: it usually matches the latest a release but in can be a bit ahead., (*12)

Test groups

Some PHPUnit test is marked as skipped (for example, tests that require a driver that support multiple layers and executed with the GD driver). In addition, if you don't have installed gmagick, the gmagick tests will be marked as skipped., (*13)

If you don't want to run tests that are marked as "always skipped" you can tell PHPUnit to exclude the always-skipped group. The same for the tests that require a specific driver (gd, imagick, imagick)., (*14)

So, for example, to exclude the always-skipped and the gmagick tests, you can launch phpunit with this command options:, (*15)

composer run test -- --exclude-group always-skipped,gmagick

Development environment

Setting up an environment with all the required libraries may be very hard. In order to run the tests locally, you can use the same docker images used by Imagine to test the pull requests., (*16)

For example, if you have Imagine locally in the /home/me/imagine folder, you can run tests for PHP 8.1 with the GD and Imagick with this very simple approach:, (*17)

  1. Launch a temporary docker container with: sh docker run --rm -it -v /home/me/imagine:/app -w /app ghcr.io/php-imagine/test:8.1-gd-imagick bash
  2. Inside the docker container, run these commands: sh # Start a local web server: some tests require it cd tests php -n -S 0.0.0.0:8013 >/dev/null 2>&1 & cd .. # Tell the tests that the local web server is available at the port 8013 export IMAGINE_TEST_WEBSERVERURL=http://localhost:8013 # Install the composer dependencies composer update # Run the tests composer run test -- --exclude-group always-skipped,gmagick

Note: This approach works on Windows too: simply launch the docker container with, (*18)

docker run --rm -it -v C:\Path\To\Imagine:/app -w /app ghcr.io/php-imagine/test:8.1-gd-imagick bash

Built test files

Many tests create temporary files (in the tests/tmp directory) containing built images. Those temporary files are compared with expected images, and then are deleted. If you want to keep those temporary files (for example, to check what's being built), you can set the IMAGINE_TEST_KEEP_TEMPFILES environment variable. If the IMAGINE_TEST_KEEP_TEMPFILES is configured in the GitHub Action tests, those temporary files are attached to tests as an articact., (*19)

The Versions

18/07 2018

dev-develop

dev-develop http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

16/05 2017

v0.7.1

0.7.1.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

02/05 2017

v0.7.0

0.7.0.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

 

The Development Requires

image manipulation graphics image processing drawing

13/02 2017

dev-revert-537-revert-526-imagick-rotate-and-canvas-size

dev-revert-537-revert-526-imagick-rotate-and-canvas-size http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

13/02 2017

dev-revert-536-revert-525-patch-1

dev-revert-536-revert-525-patch-1 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

13/02 2017

dev-revert-535-revert-505-png-compression-newer-imagemagick

dev-revert-535-revert-505-png-compression-newer-imagemagick http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

13/02 2017

dev-revert-532-revert-449-gd/applyMaskFix

dev-revert-532-revert-449-gd/applyMaskFix http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

02/02 2017

0.7.x-dev

0.7.9999999.9999999-dev http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

19/09 2015

v0.6.3

0.6.3.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

11/11 2014

0.6.2

0.6.2.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

26/08 2014

dev-master

9999999-dev http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

16/06 2014

v0.6.1

0.6.1.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

13/06 2014

v0.6.0

0.6.0.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

13/06 2014

0.5.x-dev

0.5.9999999.9999999-dev http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

10/07 2013

v0.5.0

0.5.0.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

13/12 2012

v0.4.1

0.4.1.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

07/12 2012

v0.4.0

0.4.0.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

12/11 2012

v0.3.1

0.3.1.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

29/07 2012

v0.3.0

0.3.0.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

image manipulation graphics image processing drawing

11/02 2012

dev-feature/border-filter

dev-feature/border-filter http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

image manipulation graphics image processing drawing

30/11 2011

v0.2.8

0.2.8.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

image manipulation graphics image processing drawing

18/11 2011

v0.2.7

0.2.7.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

image manipulation graphics image processing drawing

09/11 2011

v0.2.6

0.2.6.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

image manipulation graphics image processing drawing

29/10 2011

0.2.5

0.2.5.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

image manipulation graphics image processing drawing

28/10 2011

0.2.4

0.2.4.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

image manipulation graphics image processing drawing

17/10 2011

0.2.3

0.2.3.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

image manipulation graphics image processing drawing

16/10 2011

0.2.1

0.2.1.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

image manipulation graphics image processing drawing

06/10 2011

0.2.0

0.2.0.0 http://imagine.readthedocs.org/

Image processing for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

image manipulation graphics image processing drawing