Download the PHP package wjerome/imagine without Composer
On this page you can find all versions of the php package wjerome/imagine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package imagine
Imagine
🖼 Imagine (image-engine) is a PHP micro library to resize, thumbnail or apply filters to your images
Required
- PHP >= 7.2
- GD
File types supported
- jpg
- png
- gif
- webp
- bmp
Installation
Usage
Functions
Examples
Resize width
Resize height
Create thumbnail fit "stretch"
Create thumbnail fit "contain"
Create thumbnail fit "cover"
Background color transparent
Background color main color
Background color with array
Background color with hexa
Image position in thumbnail
Quality
Note: 1
In PNG the quality is not a percentage, it is a value between 0
and 9
.
0
corresponds to no compression and 9
corresponds to the maximum compression. Here are the values to fill in $image->setQuality()
:
setQuality(0)
: compression9
setQuality(1) -> setQuality(11)
: compression8
setQuality(12) -> setQuality(22)
: compression7
setQuality(23) -> setQuality(33)
: compression6
setQuality(34) -> setQuality(44)
: compression5
setQuality(45) -> setQuality(55)
: compression4
setQuality(56) -> setQuality(66)
: compression3
setQuality(67) -> setQuality(77)
: compression2
setQuality(78) -> setQuality(88)
: compression1
setQuality(89) -> setQuality(100)
: compression0
(Be careful, the file size can be important)
Note: 2
By default the quality is 100%, but if we process a PNG file, it will go through the imagepng()
function and the 100% quality makes the destination image much heavier than the source image (up to 11 times the original file size). So to avoid abuse, by default PNGs have a quality of 0% (which corresponds to a compression of 9
).
Crop auto
Crop the destination image by calculating the unused pixels
Manual cropping (in pixel)
Crop the destination image by passing the position and size in pixels
Manual cropping (in percent)
Crop the destination image by passing the position and size in percent
Convert MIME file
Add grayscale filter
Add grayscale and blur filter
Display progressively the jpg
and jpeg
images
Display on browser
Create multiple images with a single resource
Reset settings each time a file is written
Keeps the previous configuration each time the file is written
All versions of imagine with dependencies
ext-gd Version *