Functions page: 3

Construct
Creates an Imagick instance for a specified image or set of images.
None

Contrast image
Enhances the intensity differences between the lighter and darker elements of the image.
Contrast image example

bool contrastImage ( bool $sharpen )

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


Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced.
Contrast stretch image
Enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available.
Contrast stretch image example

bool contrastStretchImage ( float $black_point , float $white_point [, int $channel = Imagick::CHANNEL_ALL ] )

<?php 
$im 
= new Imagick($input);
$im->contrastStretchImage(.15.05);
$im->writeImage('contrastStretchImage.jpg'); 
$im->destroy();
 
?>
Convolve image
Applies a custom convolution kernel to the image.
None

Crop image
Extracts a region of the image.
Crop image example

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

<?php 
$im 
= new Imagick($input);
$im->cropImage1001006020 );
$im->writeImage('cropImage.jpg'); 
$im->destroy();
 
?>
Crop thumbnail image
Creates a fixed size thumbnail by first scaling the image up or down and cropping a specified area from the center.
Crop thumbnail image example

bool cropThumbnailImage ( int $width , int $height )

<?php 
$im 
= new Imagick($input);
$im->cropThumbnailImage150150 );
$im->writeImage('cropThumbnailImage.jpg'); 
$im->destroy();
 
?>
Current
Returns reference to the current imagick object with image pointer at the correct sequence.
None

Cycle colormap image
Displaces an image's colormap by a given number of positions.
Cycle colormap image example

bool cycleColormapImage ( int $displace )

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


If you do this a few times, it produces a psychedelic effect.
Decipher image
Deciphers image that has been enciphered before.
Decipher image example

bool decipherImage ( string $passphrase )

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


The image must be enciphered using encipherImage().
Deconstruct images
Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers.
Deconstruct images example

Imagick deconstructImages ( void )

<?php 
$im 
= new Imagick();
$im->readImage('addNoiseImage.jpg');
$im->readImage('adaptiveBlurImage.jpg');
$deconstruct $im->deconstructImages ();
$deconstruct->writeImage('deconstructImages.jpg'); 
$deconstruct->destroy();
 
?>


'Not working'
Delete image artifact
Deletes an artifact associated with the image.
None



The difference between image properties and image artifacts is that properties are public and artifacts are private.
Deskew image
This method can be used to remove skew from for example scanned images where the paper was not properly placed on the scanning surface.
Deskew image example
Another Deskew image example

public bool deskewImage ( float $threshold )

<?php 
$im 
= new Imagick('text.png');
$im->deskewImage80 );
$im->writeImage'deskew.jpg' );
$im->destroy();
 
?>
Despeckle image
Reduces the speckle noise in an image while preserving the edges of the original image
Despeckle image example

bool despeckleImage ( void )

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


No noticable effect
Destroy
Destroys the Imagick object and frees all resources associated with it.
Destroy example

bool destroy ( void )

<?php 
$im 
= new Imagick($input);
$im->edgeImage0.5 );
$im->writeImage('destroy.jpg'); 
$im->destroy();
 
?>
Display image
This method displays an image on a X server.
None