Functions page: 17

Set gravity
Sets the global gravity property for the Imagick object.
Set gravity example

bool setGravity ( int $gravity )

<?php 
$width 
'200';
$height '100';
$text 'Rubblewebs';
$im = new Imagick();
$draw = new ImagickDraw();
$draw->setFont('arial.ttf');
$draw->setFontSize28 );
$fillcolor = new ImagickPixel"white" );
$draw->setFillColor$fillcolor );
$draw->setGravityImagick::GRAVITY_CENTER );
$bgcolor = new ImagickPixel'Black' );
$im->newImage($width$height$bgcolor );
$im->annotateImage($draw000$text);
$im->writeImage'setGravity.jpg' );
$im->destroy();
 
?>
Set image
Replaces the current image sequence with the image from replace object.
None

Set image alpha channel
Activate or deactivate image alpha channel.
Set image alpha channel example

bool setImageAlphaChannel ( int $mode )

<?php 
$im 
= new Imagick('rotateImage.png');
$im->setImageAlphaChannelImagick::ALPHACHANNEL_OPAQUE);
$im->writeImage('setImageAlphaChannel.png'); 
$im->destroy();
 
?>


The mode is one of the ALPHACHANNEL_* constants.
Set image artifact
Associates an artifact with the image.
None



The difference between image properties and image artifacts is that properties are public and artifacts are private.
Set image background color
Sets the image background color.
Set image background color example

bool setImageBackgroundColor ( mixed $background )

<?php 
$im 
= new Imagick($input);
$shadow $im->clone(); 
$shadow->setImageBackgroundColor( new ImagickPixel'blue' ) ); 
$shadow->shadowImage8035); 
$shadow->compositeImage$imImagick::COMPOSITE_OVER0); 
$shadow->writeImage"setImageBackgroundColor.png" );
$shadow->destroy();
 
?>
Set image bias
Sets the image bias for any method that convolves an image (e.g. ConvolveImage()).
None

Set image blue primary
Sets the image chromaticity blue primary point.
None

Set image border color
Sets the image border color.
None

Set image channel depth
Sets the depth of a particular image channel.
None

Set image clip mask
Sets image clip mask from another Imagick object.
None

Set image colormap color
Sets the color of the specified colormap index.
None

Set image colorspace
Sets the image colorspace.
None

Set image compose
Sets the image composite operator.
None



Useful for specifying how to composite the image thumbnail when using the montageImage() method.
Set image compression
Sets the image compression
None



This does not actually compress the image but rather sets the compression type that is going to be used.
Set image compression quality
Sets the image compression quality.
None