Rubblewebs

THESE CODES ARE PROVIDED FOR AN EXAMPLE OF HOW TO USE IMAGEMAGICK WITH PHP. CARE SHOULD BE TAKEN WHEN ACCEPTING USER INPUT.

I TAKE NO RESPONSABILTY FOR ANY PROBLEMS THAT MAY OCCURE WHEN USING ANY OF THIS CODE.

IT IS UP TO YOU TO SECURE THE CODE AND VALIDATE USER INPUT.

Imagick Functions page: 21

Set image units

Sets the image units of resolution.

Set image units example
$im = new Imagick ($input);
$im->setImageUnits(2); 
$im->writeImage('setImageUnits.jpg'); 
$im->destroy();

( 0 = undefined, 1 = pixelsperInch, 2 = PixelsPerCentimeter )

Set image virtual pixel method

Sets the image virtual pixel method.

Set image virtual pixel method example
$im = new imagick( $input ); 
$corners = array( 0,0, 0,0, 200,0, 200,30, 200,150, 200,120, 0,150, 0,150 );
$im->setImageVirtualPixelMethod( Imagick::VIRTUALPIXELMETHOD_TRANSPARENT );
$im->setImageMatte( TRUE );
$im->distortImage( Imagick::DISTORTION_PERSPECTIVE, $corners, TRUE ); 
$im->writeImage('setImageVirtualPixelMethod.png'); 
$im->destroy();

Set image white point

Sets the image chromaticity white point.

Set interlace scheme

Sets the image compression.

Set iterator index

Set the iterator to the position in the image list specified with the index parameter.

Set last iterator

Sets the Imagick iterator to the last image.

Set option

Associates one or more options with the wand.

Set page

Sets the page geometry of the Imagick object.

Set point size

Sets object's point size property.


( This method can be used for example to set font size for caption: pseudo-format. )

Set resolution

Sets the image resolution.

Set resource limit

Sets the limit for a particular resource in megabytes.

Set resource limit example
$im = new Imagick($input);
$im->setResourceLimit( Imagick::RESOURCETYPE_MEMORY, 200);
$shadow = $im->clone(); 
$shadow->setImageBackgroundColor( new ImagickPixel( 'black' ) ); 
$shadow->shadowImage( 80, 3, 5, 5 ); 
$shadow->compositeImage( $im, Imagick::COMPOSITE_OVER, 0, 0 ); 
$shadow->writeImage( "setResourceLimit.png" );
$shadow->destroy();

Set sampling factors

Sets the image sampling factors.

Set size

Sets the size of the Imagick object.


( Set it before you read a raw image format such as RGB, GRAY, or CMYK. )

Set size offset

Sets the size and offset of the Imagick object.


( Set it before you read a raw image format such as RGB, GRAY, or CMYK. )