Functions page: 4

Display images
Displays an image or image sequence on a X server.
None

Distort image
Distorts an image using various distortion methods.
See the distort section

Draw image
Renders the ImagickDraw object on the current image.
See the draw section

Edge image
Enhance edges within the image with a convolution filter of the given radius.
Edge image example

bool edgeImage ( float $radius )

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


Use radius 0 and it will be auto-selected.
Emboss image
Returns a grayscale image with a three-dimensional effect.
Emboss image example

bool embossImage ( float $radius , float $sigma )

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


We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and it will choose a suitable radius for you.
Encipher image
Converts plain pixels to enciphered pixels.
Encipher image example

bool encipherImage ( string $passphrase )

<?php 
$im 
= new Imagick($input);
$im->encipherImage(passkey.txt);
$im->writeImage('encipherImage.png'); 
$im->destroy();
 
?>


The image is not readable until it has been deciphered using decipherImage(). You need to use a image format that is not compressed on saving e.g.png
Enhance image
Applies a digital filter that improves the quality of a noisy image.
Enhance image example

bool enhanceImage ( void )

<?php 
$im 
= new Imagick($input);
$im->enhanceImage( );
$im->writeImage('enhanceImage.jpg'); 
$im->destroy();
 
?>
Equalize image
Equalizes the image histogram.
Equalize image example

bool equalizeImage ( void )

<?php 
$im 
= new Imagick($input);
$im->equalizeImage( );
$im->writeImage('equalizeImage.jpg'); 
$im->destroy();
 
?>
Evaluate image
Applys an arithmetic, relational, or logical expression to an image.
Evaluate image example

bool evaluateImage ( int $op , float $constant [, int $channel = Imagick::CHANNEL_ALL ] )

<?php 
$im 
= new Imagick($input);
// Reduce the alpha by 50%
$im->evaluateImage(Imagick::EVALUATE_DIVIDE2Imagick::CHANNEL_ALPHA);
$im->writeImage('evaluateImage.jpg'); 
$im->destroy();
 
?>


Use these operators to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.
Export image pixels
Exports image pixels into an array
Array (
[0] => 36
[1] => 45
etc.


public array exportImagePixels ( int $x , int $y , int $width , int $height , string $map , int $STORAGE )

<?php 
$im 
= new Imagick($input);
$pixels $im->exportImagePixels(101022"RGB"Imagick::PIXEL_CHAR);
echo 
"<pre>";
print_r($pixels);
echo 
"</pre>";
 
?>


The map defines the ordering of the exported pixels. The size of the returned array is width * height * strlen(map).
Extent image
Comfortability method for setting image size.
Extent image example

bool extentImage ( int $width , int $height , int $x , int $y )

<?php 
$im 
= new Imagick($input);
$im->setImageBackgroundColorblack );
$im->extentImage2002000, -25);
$im->writeImage('extentImage.jpg'); 
$im->destroy();
 
?>


The method sets the image size and allows setting x,y coordinates where the new area begins.
Flatten images
Merges a sequence of images.
None


Imagick flattenImages ( void )

<?php /*
$im = new Imagick($input);
$top = new Imagick('newPseudoImage.jpg');
$im->compositeImage($top, Imagick::COMPOSITE_SCREEN, 0, 0 );
$im = $im->flattenImages(); 
$im->writeImage('flattenImages.jpg'); 
$im->destroy();
*/ 
?>


This is useful for combining Photoshop layers into a single image. NOT WORKING
Flip image
Creates a vertical mirror image by reflecting the pixels around the central x-axis.
Flip image example

bool flipImage ( void )

<?php 
$im 
= new Imagick($input);
$im->flipImage( );
$im->writeImage('flipImage.jpg'); 
$im->destroy();
 
?>
Flood fill paint
Changes the color value of any pixel that matches target and is an immediate neighbor.
Flood fill paint example

bool floodFillPaintImage ( mixed $fill , float $fuzz , mixed $target , int $x , int $y , bool $invert [, int $channel = Imagick::CHANNEL_DEFAULT ] )

<?php 
$im 
= new Imagick($input);
$im->floodfillPaintImage("Orange"10'#850d0f'11542FALSE);
$im->writeImage("floodfillpaint.jpg"); 
$im->destroy();
 
?>


This method is a replacement for deprecated Imagick::paintFloodFillImage().
NOT WORKING
Flop image
Creates a horizontal mirror image by reflecting the pixels around the central y-axis.
Flop image example

bool flopImage ( void )

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