\Grafika\ImagickImage

Image class for Imagick.

Summary

Methods
Properties
Constants
__construct()
__clone()
blob()
createFromFile()
createFromCore()
createBlank()
getCore()
getImageFile()
getWidth()
getHeight()
getType()
histogram()
isAnimated()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$imagick
$imageFile
$width
$height
$type
$animated
N/A

Properties

$imagick

$imagick : \Imagick

Type

\Imagick — Imagick instance

$imageFile

$imageFile : string

Type

string — File path to image

$width

$width : integer

Type

integer — Image width in pixels

$height

$height : integer

Type

integer — Image height in pixels

$type

$type : string

Type

string — Image type. Return value of Imagick::queryFormats(). See http://phpimagick.com/Imagick/queryFormats Sample values: JPEG, PNG, GIF, WBMP

$animated

$animated : boolean

Type

boolean — True if image is an animated GIF.

Methods

__construct()

__construct(\Imagick  $imagick, string  $imageFile, integer  $width, integer  $height, string  $type, boolean  $animated = false) 

Image constructor.

Parameters

\Imagick $imagick
string $imageFile
integer $width
integer $height
string $type
boolean $animated

__clone()

__clone() 

blob()

blob(string|\Grafika\ImageType  $type = 'PNG') 

Output a binary raw dump of an image in a specified format.

Parameters

string|\Grafika\ImageType $type

Image format of the dump.

Throws

\Exception

When unsupported type.

createFromFile()

createFromFile(string  $imageFile) : \Grafika\Imagick\Image

Create Image from image file.

Parameters

string $imageFile

Path to image file.

Throws

\Exception

Returns

\Grafika\Imagick\Image

createFromCore()

createFromCore(\Imagick  $imagick) : \Grafika\Imagick\Image

Create an Image from an instance of Imagick.

Parameters

\Imagick $imagick

Instance of Imagick.

Returns

\Grafika\Imagick\Image

createBlank()

createBlank(integer  $width = 1, integer  $height = 1) : self

Create a blank image.

Parameters

integer $width

Width in pixels.

integer $height

Height in pixels.

Returns

self

getCore()

getCore() : \Imagick

Get Imagick instance

Returns

\Imagick

getImageFile()

getImageFile() : string

Get image file path.

Returns

string —

File path to image.

getWidth()

getWidth() : integer

Get image width in pixels.

Returns

integer

getHeight()

getHeight() : integer

Get image height in pixels.

Returns

integer

getType()

getType() : string

Get image type.

Returns

string

histogram()

histogram(array|null  $slice = null) : array

Get histogram from an entire image or its sub-region.

Parameters

array|null $slice

Array of slice information. array( array( 0,0), array(100,50)) means x,y is 0,0 and width,height is 100,50

Returns

array —

Returns array containing RGBA bins array('r'=>array(), 'g'=>array(), 'b'=>array(), 'a'=>array())

isAnimated()

isAnimated() : boolean

Returns animated flag.

Returns

boolean —

True if animated GIF.