Functions page: 2

Chop image
Removes a region of an image and collapses the image to occupy the removed portion.
Chop image example

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

<?php 
$im 
= new Imagick($input);
$im->chopImage50508050 );
$im->writeImage('chopImage.jpg'); 
$im->destroy();
 
?>
Clear
Clears all resources associated to Imagick object
None

Clip image
Clips along the first path from the 8BIM profile, if present.
None

Clip path image
Clips along the named paths from the 8BIM profile, if present.
None



Later operations take effect inside the path. It may be a number if preceded with #, to work on a numbered path, e.g., "#1" to use the first path.
Clone
Makes an exact copy of the Imagick object.
Clone example

Imagick clone ( void )

<?php 
$im 
= new Imagick($input);
$shadow $im->clone(); 
$shadow->setImageBackgroundColor( new ImagickPixel'black' ) ); 
$shadow->shadowImage8035); 
$shadow->compositeImage$imImagick::COMPOSITE_OVER0); 
$shadow->writeImage"clone.png" );
$shadow->destroy();
 
?>
Clut image
Replaces colors in the image from a color lookup table.
Clut image example

bool clutImage ( Imagick $lookup_table [, float $channel = Imagick::CHANNEL_DEFAULT ] )

<?php 
$im 
= new Imagick($input);
$clut = new Imagick('gradient.png');
$im->clutImage$clut );
$im->writeImage('clutImage.jpg'); 
$im->destroy();
 
?>


Optional second parameter to replace colors in a specific channel. This method is available if Imagick has been compiled against ImageMagick version 6.3.6 or newer.
Coalesce images
Composites a set of images while respecting any page offsets and disposal methods.
None



GIF, MIFF, and MNG animation sequences typically start with an image background and each subsequent image varies in size and offset. Returns a new Imagick object where each image in the sequence is the same size as the first and composited with the next image in the sequence.
Color floodfill image
Changes the color value of any pixel that matches target and is an immediate neighbor.
Color floodfill image example

bool colorFloodfillImage ( mixed $fill , float $fuzz , mixed $bordercolor , int $x , int $y )

<?php 
$im 
= new Imagick('charcoalImage.jpg');
$im->colorFloodfillImageRed0white5235 );
$im->writeImage('colorFloodfillImage.jpg'); 
$im->destroy();
 
?>
Colorize image
Blends the fill color with each pixel in the image.
Colorize image example

bool colorizeImage ( mixed $colorize , mixed $opacity )

<?php 
$im 
= new Imagick($input);
$im->colorizeImage'#0000b0'0.5 );
$im->writeImage('colorizeImage.jpg'); 
$im->destroy();
 
?>
Combine images
Combines one or more images into a single image.
Combine images example

Imagick combineImages ( int $channelType )

<?php 
$im 
= new Imagick ();
$im->newImage(200150, new ImagickPixel('transparent'));
$imr = new Imagick('separateImagechannel_r.jpg');
$imb = new Imagick('separateImagechannel_g.jpg' );
$img = new Imagick('separateImagechannel_b.jpg');
$im->addimage($imr);
$im->addimage($imb);
$im->addimage($img);
$im->flattenImages(); 
$im $im->combineImagesImagick::CHANNEL_ALL );
$im->writeImage('combineImages.jpg'); 
$im->destroy();
 
?>


The grayscale value of the pixels of each image in the sequence is assigned in order to the specified channels of the combined image. The typical ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
God knows what this is supposed to mean: To apply to more than one channel, combine channeltype constants using bitwise operators.
Comment image
Adds a comment to your image.
Comment image example

bool commentImage ( string $comment )

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


The comment is within the image data.
Compare Image channels
Compares one or more images and returns the difference image.
None

Compare image layers
Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers.
None

Compare images
Returns an array containing a reconstructed image and the difference between images.
None

Composite image
Composite one image onto another at the specified offset.
Composite image example

bool compositeImage ( Imagick $composite_object , int $composite , int $x , int $y [, int $channel = Imagick::CHANNEL_ALL ] )

<?php 
$imagick 
= new Imagick($input);
$imagick->blurImage(0,.5);

$overlay = new Imagick($image);
$imagick->compositeImage($overlayimagick::COMPOSITE_SOFTLIGHT00);

$imagick->writeImage("compositeImage.jpg");
 
?>


Softlight effect