class Image implements ImageInterface

Image class for Imagick.

Methods

__construct(Imagick $imagick, string $imageFile, int $width, int $height, string $type, bool $animated = false)

Image constructor.

__clone()

No description

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

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

static ImageInterface
createFromFile(string $imageFile)

No description

static ImageInterface
createFromCore(Imagick $imagick)

Create an Image from an instance of Imagick.

static ImageInterface
createBlank(int $width = 1, int $height = 1)

Create a blank image.

resource|Imagick
getCore()

Get Imagick instance

string
getImageFile()

Get image file path.

int
getWidth()

Get image width in pixels.

int
getHeight()

Get image height in pixels.

string
getType()

Get image type.

array
histogram(array|null $slice = null)

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

bool
isAnimated()

Returns animated flag.

Details

at line line 54
__construct(Imagick $imagick, string $imageFile, int $width, int $height, string $type, bool $animated = false)

Image constructor.

Parameters

Imagick $imagick
string $imageFile
int $width
int $height
string $type
bool $animated

at line line 63
__clone()

at line line 77
blob(string|ImageType $type = 'PNG')

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

Parameters

string|ImageType $type Image format of the dump. See Grafika\ImageType for supported formats.

Exceptions

Exception When unsupported type.

at line line 88
static ImageInterface createFromFile(string $imageFile)

Parameters

string $imageFile Path to image file.

Return Value

ImageInterface Instance of image.

Exceptions

Exception

at line line 118
static ImageInterface createFromCore(Imagick $imagick)

Create an Image from an instance of Imagick.

Parameters

Imagick $imagick Instance of Imagick.

Return Value

ImageInterface Instance of image.

at line line 130
static ImageInterface createBlank(int $width = 1, int $height = 1)

Create a blank image.

Parameters

int $width Width of image in pixels.
int $height Height of image in pixels.

Return Value

ImageInterface Instance of image.

at line line 144
resource|Imagick getCore()

Get Imagick instance

Return Value

resource|Imagick GD resource or Imagick instance

at line line 153
string getImageFile()

Get image file path.

Return Value

string File path to image if Image was created from an image file.

at line line 162
int getWidth()

Get image width in pixels.

Return Value

int Width in pixels.

at line line 171
int getHeight()

Get image height in pixels.

Return Value

int Height in pixels.

at line line 180
string getType()

Get image type.

Return Value

string Type of image. See ImageType.

at line line 191
array histogram(array|null $slice = null)

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

Return Value

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

at line line 265
bool isAnimated()

Returns animated flag.

Return Value

bool True if animated GIF or false otherwise.