Download the PHP package meriksk/php-image without Composer
On this page you can find all versions of the php package meriksk/php-image. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-image
PHP-Image Library
The Image class offers a bunch of image processing features using GD or IMagick.
Requirements
- PHP >=5.6
Supported Image Libraries
- GD Library (>=2.0)
- Imagick PHP extension (>=6.5.7)
Setup
The preferred way to install this extension is through Composer. If you do not have Composer, you may install it by following the instructions at getcomposer.org.
Either run
or add
to your composer.json and run composer update
Usage
- Open image
- Resize image
- Crop image
Open image
Because this class uses namespacing, when instantiating the object, you need to either use the fully qualified namespace:
or alias it:
This class can use Imagick or GD extension - whichever is available. Imagick extension is preferred if is available. You can force the extension for manipulating images as follows:
Save image
Library supports three formats of image: 'jpeg', 'png' and 'gif'. By default they quality is set to 75. When saving to disk or outputting into the browser, the script assumes the same output type and quality as input.
Save in a different type to the source:
Output image
To render the image directly into the browser, you can call:
Resize
resize
resize to width
resize to height
resize to best fit
resize to long side
resize to short side
Crop
manual crop
automatic crop
Thumbnail
Rotate image
Rotating is counter clockwise;
Rotate on 90 degrees:
Rotate on 45 degrees, and fill empty field with white color:
Flip image
Flip in vertical direction:
Flip in horisontal direction:
Flip in both directions:
Filters
todo