Functions page: 12

Imagick version
Imagick version
None


Imagick::IMAGICK_EXTVER

<?php 
$version 
Imagick::IMAGICK_EXTVER;

echo 
$version;
 
?>


3.0.1
Implode image
Creates a new image that is a copy of an existing one with the image pixels "imploded" by the specified percentage.
Implode image example

bool implodeImage ( float $radius )

<?php 
$im 
= new Imagick($input);
$im->implodeImage10 );
$im->writeImage('implodeImage.jpg'); 
$im->destroy();
 
?>
Import image pixels
Imports pixels from an array into an image.
None



The map is usually 'RGB'. This method imposes the following constraints for the parameters: amount of pixels in the array must match width x height x length of the map.
Is similar
Checks the distance between the color described by this ImagickPixel object
The colours are the same within the tolerance


isSimilar ( ImagickPixel $color , float $fuzz )

<?php 
$im 
= new Imagick($input);
$pixel $im->getImagePixelColor7822 );
$compair = new ImagickPixel();
$compair->setColor("rgb(105,134,6)");
$output $compair->isSimilar($pixel0.2);
if ( 
$output ) { echo "<br/>The colours are the same within the tolerance";}
else echo 
"<br/>The colours are Different";
$im->destroy();
 
?>


Checks the distance between the color described by this ImagickPixel object and that of the provided object, by plotting their RGB values on the color cube. If the distance between the two points is less than the fuzz value given, the colors are similar.
Label image
Adds a label to an image.
None

levelImage
Adjusts the levels of an image by scaling the colors falling between specified white and black points to the full available quantum range.
levelImage example

bool levelImage ( float $blackPoint , float $gamma , float $whitePoint [, int $channel = Imagick::CHANNEL_ALL ] )

<?php 
$im 
= new Imagick($input);
$im->levelImage (1001.065000); 
$im->writeImage('levelImage.jpg'); 
$im->destroy();
 
?>


The parameters provided represent the black, mid, and white points. The black point specifies the darkest color in the image. Colors darker than the black point are set to zero. Mid point specifies a gamma correction to apply to the image. White point specifies the lightest color in the image. Colors brighter than the white point are set to the maximum quantum value.
Linear stretchImage
Stretches with saturation the image intensity.
Linear stretchImage example

bool linearStretchImage ( float $blackPoint , float $whitePoint )

<?php 
$im 
= new Imagick($input);
$im->linearStretchImage 1'2%' ); 
$im->writeImage('linearStretchImage.jpg'); 
$im->destroy();
 
?>
Liquid rescale image
This method scales the images using liquid rescaling method.
None



This method is an implementation of a technique called seam carving. In order for this method to work as expected ImageMagick must be compiled with liblqr support.
Magnify image
Is a convenience method that scales an image proportionally to twice its original size.
Magnify image example

bool magnifyImage ( void )

<?php 
$im 
= new Imagick($input);
$im->magnifyImage(); 
$im->writeImage('magnifyImage.jpg'); 
$im->destroy();
 
?>
Map image
Replaces the colors of an image with the closest color from a reference image.
Map image example

bool mapImage ( Imagick $map , bool $dither )

<?php 
$im 
= new Imagick ($input);
$im1 = new Imagick ('solarizeImage.jpg');
$im->mapImage$im110 );
$im->writeImage('mapImage.jpg'); 
$im->destroy();
 
?>
Matte flood fill image
Changes the transparency value of any pixel that matches target and is an immediate neighbor.
None



If the method FillToBorderMethod is specified, the transparency value is changed for any neighbor pixel that does not match the bordercolor member of image.
Median filter image
Applies a digital filter that improves the quality of a noisy image.
Median filter image example

bool medianFilterImage ( float $radius )

<?php 
$im 
= new Imagick($input);
$im->medianFilterImage);
$im->writeImage('medianFilterImage.jpg'); 
$im->destroy();
 
?>


Each pixel is replaced by the median in a set of neighboring pixels as defined by radius.
Merge image layers
Merges image layers into one.
None



This method is useful when working with image formats that use multiple layers such as PSD. The merging is controlled using the layer_method which defines how the layers are merged.
Minify image
Is a convenience method that scales an image proportionally to one-half its original size
Minify image example

bool minifyImage ( void )

<?php 
$im 
= new Imagick($input);
$im->minifyImage();
$im->writeImage('minifyImage.jpg'); 
$im->destroy();
 
?>



modulateImage
Lets you control the brightness, saturation, and hue of an image.
modulateImage example

bool modulateImage ( float $brightness , float $saturation , float $hue )

<?php $im = new Imagick($input);
$im->modulateImage(10010080);
$im->writeImage('modulateImage.jpg'); 
$im->destroy();
 
?>


Hue is the percentage of absolute rotation from the current position. For example 50 results in a counter-clockwise rotation of 90 degrees, 150 results in a clockwise rotation of 90 degrees, with 0 and 200 both resulting in a rotation of 180 degrees.