Functions page: 14

Paint transparent image
Changes any pixel that matches color with the color defined by fill.
Paint transparent image example

bool paintTransparentImage ( mixed $target , float $alpha , float $fuzz )

<?php 
$im 
= new Imagick($input);
$im->paintTransparentImage('rgb(108,5,9)'0.56000);
$im->writeImage('paintTransparentImage.png'); 
$im->destroy();
 
?>


The fuzz is not a percent
Ping image
This method can be used to query image width, height, size, and format without reading the whole image in to memory.
Output below


bool pingImage ( string $filename )

<?php 
$image 
$input;
$im = new Imagick();
$im->pingImage$image );
$info $im->identifyImage();
echo 
"<pre>";
print_r($info);
echo 
"</pre>";
 
?>


Array
(
[imageName] => /home/usr/public_html/imagemagick/imagick/temp.jpg
[format] => JPEG (Joint Photographic Experts Group JFIF format)
[geometry] => Array
(
[width] => 200
[height] => 150
)
[resolution] => Array
(
[x] => 72
[y] => 72
)

[units] => PixelsPerInch
[type] => Bilevel
[colorSpace] => RGB
[compression] => JPEG
[fileSize] => 16.2kb
)
Ping image blob
This method can be used to query image width, height, size, and format without reading the whole image to memory.
width = 200 height = 150


bool pingImageBlob ( string $image )

<?php 
$image 
file_get_contents($input);
$im = new Imagick();
$im->pingImageBlob($image);
echo 
'width = '.$im->getImageWidth() . ' height = ' $im->getImageHeight();
 
?>
Ping image file
This method can be used to query image width, height, size, and format without reading the whole image to memory.
None

Polaroid image
Simulates a Polaroid picture.
Polaroid image example

bool polaroidImage ( ImagickDraw $properties , float $angle )

<?php 
$im 
= new Imagick($input);
$im->polaroidImage(new ImagickDraw(), 15);
$im->writeImage('polaroidImage.png'); 
$im->destroy();
 
?>
Posterize image
Reduces the image to a limited number of color level.
Posterize image example

bool posterizeImage ( int $levels , bool $dither )

<?php 
$im 
= new Imagick($input);
$im->posterizeImage25610);
$im->writeImage('posterizeImage.jpg'); 
$im->destroy();
 
?>
Preview images
Tiles 9 thumbnails of the specified image with an image processing operation applied at varying strengths.
Not working


bool previewImages ( int $preview )

<?php 
$im 
= new Imagick($input);
$im->previewImagesimagick::PREVIEW_ROTATE ); 
$im->destroy();
 
?>


This is helpful to quickly pin-point an appropriate parameter for an image processing operation.
Previous image
Assocates the previous image in an image list with the Imagick object.
None

Profile image
Adds or removes a ICC, IPTC, or generic profile from an image.
None



If the profile is NULL, it is removed from the image otherwise added. Use a name of '*' and a profile of NULL to remove all profiles from the image.
Quantize image
Analyzes the colors within a reference image
None

Quantize images
Analyzes the colors within a sequence of images
None

Query font metrics
Returns a multi-dimensional array representing the font metrics.



array queryFontMetrics ( ImagickDraw $properties , string $text [, bool $multiline ] )

<?php 
$im 
= new Imagick();
$draw = new ImagickDraw();
$draw->setFont('Times-Bold');
$metrics $im->queryFontMetrics($draw"Rubblewebs");
echo 
"<pre>";
print_r($metrics);
echo 
"</pre>";
 
?>


Array
(
[characterWidth] => 12
[characterHeight] => 12
[ascender] => 9
[descender] => -3
[textWidth] => 63.90625
[textHeight] => 18
[maxHorizontalAdvance] => 13
[boundingBox] => Array
(
[x1] => 0.09375
[y1] => 0
[x2] => 8.484375
[y2] => 9
)

[originX] => 64
[originY] => 0
)
Query fonts
Returns the configured fonts.



array queryFonts ([ string $pattern = "*" ] )

<?php 
$im 
= new Imagick(); 
$fonts $im->queryFonts();
echo 
"<br /><b>Fonts available:</b>";
foreach( 
$fonts as $key=>$value ){
 echo 
"<br/>$value";
}
 
?>


Fonts available:
AvantGarde-Book
AvantGarde-BookOblique
AvantGarde-Demi
etc.
Query formats
Returns formats supported by Imagick.



array queryFormats ([ string $pattern = "*" ] )

<?php 
$im 
= new Imagick(); 
$formats $im->queryFormats();
echo 
"<br /><b>Formats supported:</b>";
foreach( 
$formats as $key=>$value ){
 echo 
"<br/>$value";
}
 
?>


Supported formats :
A
AI
ART
ARW
AVI
etc.
Radial blur image
Radial blurs an image.
Radial blur image example

bool radialBlurImage ( float $angle [, int $channel = Imagick::CHANNEL_ALL ] )

<?php 
$im 
= new Imagick($input); 
$im->radialBlurImage10 );
$im->writeImage"radialBlurImage.jpg" );
$im->destroy();
 
?>