Method |
Description |
|
apply ( Image &$image, Grafika\FilterInterface $filter ) : Editor |
Apply a filter to the image. See Filters section for a list of available filters. |
|
blend ( Image &$image1, Image $image2, string $type = 'normal', float $opacity = 1, string $position = 'top-left', integer $offsetX, integer $offsetY ) : Editor |
Blend two images together with the first image as the base and the second image on top. Supports several blend modes. |
|
compare ( Grafika\ImageInterface | string $image1, Grafika\ImageInterface | string $image2 ) : integer |
Compare two images and returns a hamming distance. A value of 0 indicates a likely similar picture. A value between 1 and 10 is potentially a variation. A value greater than 10 is likely a different image. |
|
crop ( Image &$image, integer $cropWidth, integer $cropHeight, string $position = 'center', integer $offsetX, integer $offsetY ) : Editor |
Crop the image to the given dimension and position. |
|
draw ( Image &$image, Grafika\DrawingObjectInterface $drawingObject ) |
Draw a DrawingObject on the image. See Drawing Objects section. |
|
equal ( string | Grafika\ImageInterface $image1, string | Grafika\ImageInterface $image2 ) : boolean |
Compare if two images are equal. It will compare if the two images are of the same width and height. If the dimensions differ, it will return false. If the dimensions are equal, it will loop through each pixels. If one of the pixel don't match, it will return false. The pixels are compared using their RGB (Red, Green, Blue) values. |
|
fill ( Image &$image, Color $color, integer $x, integer $y ) : Editor |
Fill entire image with color. |
|
flatten ( Image &$image ) : Editor |
Flatten if animated GIF. Do nothing otherwise. |
|
flip ( Image &$image, string $mode ) : Editor |
Flip or mirrors the image. |
|
free ( Image &$image ) : Editor |
Free the image clearing resources associated with it. |
|
gdAlpha ( float $alpha ) : integer |
Convert alpha value of 0 - 1 to GD compatible alpha value of 0 - 127 where 0 is opaque and 127 is transparent |
|
isAvailable ( ) : boolean |
Checks if the editor is available on the current PHP install. |
|
opacity ( Image &$image, float $opacity ) : Editor |
Sets the image to the specified opacity level where 1.0 is fully opaque and 0.0 is fully transparent. |
|
open ( Image &$image, string $imageFile ) : Editor |
Open an image file and assign Image to first parameter. |
|
resize ( Image &$image, integer $newWidth, integer $newHeight, string $mode = 'fit' ) : Editor |
Wrapper function for the resizeXXX family of functions. Resize image given width, height and mode. |
|
resizeExact ( Image &$image, integer $newWidth, integer $newHeight ) : Editor |
Resize image to exact dimensions ignoring aspect ratio. Useful if you want to force exact width and height. |
|
resizeExactHeight ( Image &$image, integer $newHeight ) : Editor |
Resize image to exact height. Width is auto calculated. Useful for creating row of images with the same height. |
|
resizeExactWidth ( Image &$image, integer $newWidth ) : Editor |
Resize image to exact width. Height is auto calculated. Useful for creating column of images with the same width. |
|
resizeFill ( Image &$image, integer $newWidth, integer $newHeight ) : Editor |
Resize image to fill all the space in the given dimension. Excess parts are cropped. |
|
resizeFit ( Image &$image, integer $newWidth, integer $newHeight ) : Editor |
Resize image to fit inside the given dimension. No part of the image is lost. |
|
rotate ( Image &$image, integer $angle, Color | null $color = null ) : Grafika\EditorInterface |
Rotate an image counter-clockwise. |
|
save ( Image $image, string $file, null | string $type = null, null | string $quality = null, boolean | false $interlace = false, integer $permission = 493 ) : Editor |
Save the image to an image format. |
|
text ( Image &$image, string $text, integer $size = 12, integer $x, integer $y, Color $color = null, string $font = '', integer $angle ) : Grafika\EditorInterface |
Write text to image. |
|