Imagick
extends AbstractAdapter
in package
Imagick adapter class
Tags
Table of Contents
Constants
- IMAGE_CMYK = 3
- IMAGE_GRAY = 1
- Colorspace constants
- IMAGE_RGB = 2
Properties
- $adjust : AdjustInterface|null
- Image adjust object
- $colorspace : int
- Image colorspace
- $compression : int|null
- Image compression
- $draw : DrawInterface|null
- Image draw object
- $effect : EffectInterface|null
- Image effect object
- $exif : array<string|int, mixed>
- EXIF data
- $filter : FilterInterface|null
- Image filter object
- $format : string
- Image format
- $height : int
- Image height
- $imageBlur : float
- Image blur
- $imageFilter : int
- Image filter
- $indexed : bool
- Index color flag
- $layer : LayerInterface|null
- Image layer object
- $name : string
- Image name
- $quality : int
- Image quality
- $resource : mixed
- Image resource
- $type : TypeInterface|null
- Image type object
- $width : int
- Image width
Methods
- __construct() : mixed
- Constructor
- __get() : mixed
- Magic get method to return a manipulation object
- __toString() : string
- Output the image
- addImage() : Imagick
- Add image to the image resource
- adjust() : AdjustInterface
- Get the image adjust object
- convert() : Imagick
- Convert the image object to another format
- create() : Imagick
- Create a new image resource
- createColor() : ImagickPixel
- Create and return a color.
- createIndex() : Imagick
- Create a new image resource
- createResource() : void
- Create the image resource
- crop() : Imagick
- Crop the image object to a image whose dimensions are based on the value of the $wid and $hgt argument. The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped.
- cropImage() : Imagick
- Crop image, checking for multiple frames
- cropThumb() : Imagick
- Crop the image object to a square image whose dimensions are based on the value of the $px argument. The optional $offset argument allows for the adjustment of the crop to select a certain area of the image to be cropped.
- cropThumbnailImage() : Imagick
- Crop image, checking for multiple frames
- destroy() : void
- Destroy the image object and the related image file directly
- draw() : DrawInterface
- Get the image draw object
- effect() : EffectInterface
- Get the image effect object
- filter() : FilterInterface
- Get the image filter object
- flip() : Imagick
- Method to flip the image over the x-axis
- flop() : Imagick
- Method to flip the image over the y-axis
- getColorspace() : int
- Get the colorspace
- getCompression() : int
- Get the image compression
- getExif() : array<string|int, mixed>
- Get the image EXIF data
- getFormat() : string
- Get the image format
- getHeight() : int
- Get the image height
- getImageBlur() : float
- Get the image blur
- getImageFilter() : int
- Get the image filter
- getImages() : Imagick
- Get images
- getName() : string
- Get the image name
- getNumberOfImages() : int
- Get number of images
- getQuality() : int
- Get the image quality
- getResource() : mixed
- Get the image resource
- getWidth() : int
- Get the image width
- hasImages() : bool
- Does image have images
- hasResource() : bool
- Determine if there is an image resource
- isCmyk() : bool
- Determine if the image is CMYK
- isGray() : bool
- Determine if the image is grayscale
- isIndexed() : bool
- Determine if the image is index color
- isRgb() : bool
- Determine if the image is RGB
- layer() : LayerInterface
- Get the image layer object
- load() : Imagick
- Load the image resource from the existing image file
- loadFromString() : Imagick
- Load the image resource from data
- outputToHttp() : void
- Output the image object directly to HTTP
- outputToRawString() : string|false
- Output the image object to a raw string
- rebuildImages() : Imagick
- Get images
- resize() : Imagick
- Resize the image object, allowing for the largest dimension to be scaled to the value of the $px argument.
- resizeImage() : Imagick
- Resize image, checking for multiple frames
- resizeToHeight() : Imagick
- Resize the image object to the height parameter passed
- resizeToWidth() : Imagick
- Resize the image object to the width parameter passed
- rotate() : Imagick
- Rotate the image object
- scale() : Imagick
- Scale the image object, allowing for the dimensions to be scaled proportionally to the value of the $scl argument.
- sendHeaders() : void
- Send image headers the image
- setCompression() : Imagick
- Set the image compression
- setImageBlur() : Imagick
- Set the image blur
- setImageColorspace() : Imagick
- Set the image colorspace
- setImageFilter() : Imagick
- Set the image filter
- setQuality() : static
- Set the image quality
- setResolution() : Imagick
- Set the image resolution
- type() : TypeInterface
- Get the image type object
- writeToFile() : void
- Write the image object to a file on disk
Constants
IMAGE_CMYK
public
mixed
IMAGE_CMYK
= 3
IMAGE_GRAY
Colorspace constants
public
mixed
IMAGE_GRAY
= 1
IMAGE_RGB
public
mixed
IMAGE_RGB
= 2
Properties
$adjust
Image adjust object
protected
AdjustInterface|null
$adjust
= null
$colorspace
Image colorspace
protected
int
$colorspace
= 2
$compression
Image compression
protected
int|null
$compression
= null
$draw
Image draw object
protected
DrawInterface|null
$draw
= null
$effect
Image effect object
protected
EffectInterface|null
$effect
= null
$exif
EXIF data
protected
array<string|int, mixed>
$exif
= []
$filter
Image filter object
protected
FilterInterface|null
$filter
= null
$format
Image format
protected
string
$format
= 'jpg'
$height
Image height
protected
int
$height
= 480
$imageBlur
Image blur
protected
float
$imageBlur
= 1
$imageFilter
Image filter
protected
int
$imageFilter
= \Imagick::FILTER_LANCZOS
$indexed
Index color flag
protected
bool
$indexed
= false
$layer
Image layer object
protected
LayerInterface|null
$layer
= null
$name
Image name
protected
string
$name
= 'pop-image.jpg'
$quality
Image quality
protected
int
$quality
= 100
$resource
Image resource
protected
mixed
$resource
= null
$type
Image type object
protected
TypeInterface|null
$type
= null
$width
Image width
protected
int
$width
= 640
Methods
__construct()
Constructor
public
__construct() : mixed
Instantiate an image object based on either a pre-existing image file on disk, or a new image file.
__get()
Magic get method to return a manipulation object
public
__get(string $name) : mixed
Parameters
- $name : string
__toString()
Output the image
public
__toString() : string
Return values
stringaddImage()
Add image to the image resource
public
addImage(mixed $image[, int|null $delay = null ]) : Imagick
Parameters
- $image : mixed
- $delay : int|null = null
Tags
Return values
Imagickadjust()
Get the image adjust object
public
adjust() : AdjustInterface
Return values
AdjustInterfaceconvert()
Convert the image object to another format
public
convert(string $type) : Imagick
Parameters
- $type : string
Return values
Imagickcreate()
Create a new image resource
public
create([int|null $width = null ][, int|null $height = null ][, string|null $name = null ]) : Imagick
Parameters
- $width : int|null = null
- $height : int|null = null
- $name : string|null = null
Return values
ImagickcreateColor()
Create and return a color.
public
createColor([ColorInterface|null $color = null ][, int $alpha = 100 ]) : ImagickPixel
Parameters
- $color : ColorInterface|null = null
- $alpha : int = 100
Tags
Return values
ImagickPixelcreateIndex()
Create a new image resource
public
createIndex([int|null $width = null ][, int|null $height = null ][, string|null $name = null ]) : Imagick
Parameters
- $width : int|null = null
- $height : int|null = null
- $name : string|null = null
Tags
Return values
ImagickcreateResource()
Create the image resource
public
createResource() : void
crop()
Crop the image object to a image whose dimensions are based on the value of the $wid and $hgt argument. The optional $x and $y arguments allow for the adjustment of the crop to select a certain area of the image to be cropped.
public
crop(int $w, int $h[, int $x = 0 ][, int $y = 0 ]) : Imagick
Parameters
- $w : int
- $h : int
- $x : int = 0
- $y : int = 0
Return values
ImagickcropImage()
Crop image, checking for multiple frames
public
cropImage(int $width, int $height, int $x, int $y) : Imagick
Parameters
- $width : int
- $height : int
- $x : int
- $y : int
Return values
ImagickcropThumb()
Crop the image object to a square image whose dimensions are based on the value of the $px argument. The optional $offset argument allows for the adjustment of the crop to select a certain area of the image to be cropped.
public
cropThumb(int $px[, int|null $offset = null ]) : Imagick
Parameters
- $px : int
- $offset : int|null = null
Return values
ImagickcropThumbnailImage()
Crop image, checking for multiple frames
public
cropThumbnailImage(int $width, int $height) : Imagick
Parameters
- $width : int
- $height : int
Return values
Imagickdestroy()
Destroy the image object and the related image file directly
public
destroy([bool $delete = false ]) : void
Parameters
- $delete : bool = false
draw()
Get the image draw object
public
draw() : DrawInterface
Return values
DrawInterfaceeffect()
Get the image effect object
public
effect() : EffectInterface
Return values
EffectInterfacefilter()
Get the image filter object
public
filter() : FilterInterface
Return values
FilterInterfaceflip()
Method to flip the image over the x-axis
public
flip() : Imagick
Return values
Imagickflop()
Method to flip the image over the y-axis
public
flop() : Imagick
Return values
ImagickgetColorspace()
Get the colorspace
public
getColorspace() : int
Return values
intgetCompression()
Get the image compression
public
getCompression() : int
Return values
intgetExif()
Get the image EXIF data
public
getExif() : array<string|int, mixed>
Return values
array<string|int, mixed>getFormat()
Get the image format
public
getFormat() : string
Return values
stringgetHeight()
Get the image height
public
getHeight() : int
Return values
intgetImageBlur()
Get the image blur
public
getImageBlur() : float
Return values
floatgetImageFilter()
Get the image filter
public
getImageFilter() : int
Return values
intgetImages()
Get images
public
getImages() : Imagick
Return values
ImagickgetName()
Get the image name
public
getName() : string
Return values
stringgetNumberOfImages()
Get number of images
public
getNumberOfImages() : int
Return values
intgetQuality()
Get the image quality
public
getQuality() : int
Return values
intgetResource()
Get the image resource
public
getResource() : mixed
getWidth()
Get the image width
public
getWidth() : int
Return values
inthasImages()
Does image have images
public
hasImages() : bool
Return values
boolhasResource()
Determine if there is an image resource
public
hasResource() : bool
Return values
boolisCmyk()
Determine if the image is CMYK
public
isCmyk() : bool
Return values
boolisGray()
Determine if the image is grayscale
public
isGray() : bool
Return values
boolisIndexed()
Determine if the image is index color
public
isIndexed() : bool
Return values
boolisRgb()
Determine if the image is RGB
public
isRgb() : bool
Return values
boollayer()
Get the image layer object
public
layer() : LayerInterface
Return values
LayerInterfaceload()
Load the image resource from the existing image file
public
load([string|null $name = null ]) : Imagick
Parameters
- $name : string|null = null
Tags
Return values
ImagickloadFromString()
Load the image resource from data
public
loadFromString(string $data[, string|null $name = null ]) : Imagick
Parameters
- $data : string
- $name : string|null = null
Tags
Return values
ImagickoutputToHttp()
Output the image object directly to HTTP
public
outputToHttp([int|null $quality = null ][, string|null $to = null ][, bool $download = false ][, bool $sendHeaders = true ][, array<string|int, mixed> $headers = [] ]) : void
Parameters
- $quality : int|null = null
- $to : string|null = null
- $download : bool = false
- $sendHeaders : bool = true
- $headers : array<string|int, mixed> = []
Tags
outputToRawString()
Output the image object to a raw string
public
outputToRawString([int $quality = 100 ]) : string|false
Parameters
- $quality : int = 100
Tags
Return values
string|falserebuildImages()
Get images
public
rebuildImages(Imagick $images) : Imagick
Parameters
- $images : Imagick
Tags
Return values
Imagickresize()
Resize the image object, allowing for the largest dimension to be scaled to the value of the $px argument.
public
resize(int $px) : Imagick
Parameters
- $px : int
Return values
ImagickresizeImage()
Resize image, checking for multiple frames
public
resizeImage(int $width, int $height[, int|null $filter = null ][, int|null $blur = null ]) : Imagick
Parameters
- $width : int
- $height : int
- $filter : int|null = null
- $blur : int|null = null
Return values
ImagickresizeToHeight()
Resize the image object to the height parameter passed
public
resizeToHeight(int $h) : Imagick
Parameters
- $h : int
Return values
ImagickresizeToWidth()
Resize the image object to the width parameter passed
public
resizeToWidth(int $w) : Imagick
Parameters
- $w : int
Return values
Imagickrotate()
Rotate the image object
public
rotate(int $degrees[, ColorInterface|null $bgColor = null ]) : Imagick
Parameters
- $degrees : int
- $bgColor : ColorInterface|null = null
Return values
Imagickscale()
Scale the image object, allowing for the dimensions to be scaled proportionally to the value of the $scl argument.
public
scale(float $scale) : Imagick
Parameters
- $scale : float
Return values
ImagicksendHeaders()
Send image headers the image
public
sendHeaders([string|null $to = null ][, bool $download = false ][, array<string|int, mixed> $additionalHeaders = [] ]) : void
Parameters
- $to : string|null = null
- $download : bool = false
- $additionalHeaders : array<string|int, mixed> = []
setCompression()
Set the image compression
public
setCompression(int $compression) : Imagick
Parameters
- $compression : int
Return values
ImagicksetImageBlur()
Set the image blur
public
setImageBlur(float $blur) : Imagick
Parameters
- $blur : float
Return values
ImagicksetImageColorspace()
Set the image colorspace
public
setImageColorspace(int $colorspace) : Imagick
Parameters
- $colorspace : int
Return values
ImagicksetImageFilter()
Set the image filter
public
setImageFilter(int $filter) : Imagick
Parameters
- $filter : int
Return values
ImagicksetQuality()
Set the image quality
public
setQuality(int $quality) : static
Parameters
- $quality : int
Tags
Return values
staticsetResolution()
Set the image resolution
public
setResolution(int $x[, int|null $y = null ]) : Imagick
Parameters
- $x : int
- $y : int|null = null
Return values
Imagicktype()
Get the image type object
public
type() : TypeInterface
Return values
TypeInterfacewriteToFile()
Write the image object to a file on disk
public
writeToFile([string|null $to = null ][, int|null $quality = null ]) : void
Parameters
- $to : string|null = null
- $quality : int|null = null