Download the PHP package kennynguyeenx/image-service without Composer
On this page you can find all versions of the php package kennynguyeenx/image-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kennynguyeenx/image-service
More information about kennynguyeenx/image-service
Files in kennynguyeenx/image-service
Package image-service
Short Description Provide some functions to convert images.
License MIT
Informations about the package image-service
kennynguyeenx/image-service
Provide some functions to manipulate images
Features
- Resize image
- Set background color for image
- Create bigger image with old image in the center
- Convert image to the other type
- Dependencies: imagemagick, webp
- PSR-4 compatible.
- Compatible with PHP >= PHP 7.
Installation
-
You can download image-service through https://github.com/kennynguyeenx/image-service.
-
image-service requires the Multibyte String extension and the Imagick extension from PHP.
-
Typically you can use the configure option
--enable-mbstring
while compiling PHP to have the Multibyte String extension. More information can be found in the PHP documentation. - Imagick is a native php extension to create and modify images using the ImageMagick API. More information can be found in the PHP documentation.
Usage
-
Resize image:
-
$options should consist these keys: width (width of new image), height (height of new image), background (background color of new image if using canvas)
-
I created a file to run in console to manipulate images as an example of using this class
-
It's located at bin directory with name manipulate_image.php
- You can follow these steps to resize and convert image to the other type:
- Save a image under the folder that you want. For me, i save it under images/source folder as example_image.png
-
This image have size is 300x300. We will try to resize it to 200x200 and convert it from png to gif. We can run this command:
- This is the result:
All versions of image-service with dependencies
ext-mbstring Version *
ext-imagick Version *
intervention/image Version ^2.4