Functions page: 15

Raise image
Creates a simulated three-dimensional button-like effect by lightening and darkening the edges of the image.
Raise image example

bool raiseImage ( int $width , int $height , int $x , int $y , bool $raise )

<?php 
$im 
= new Imagick($input); 
$im->raiseImage1010200150False );
$im->writeImage"raiseImage.jpg" );
$im->destroy();
 
?>


Members width and height of raise_info define the width of the vertical and horizontal edge of the effect.
Random threshold image
Changes the value of individual pixels based on the intensity of each pixel compared to threshold.
Random threshold image example

bool randomThresholdImage ( float $low , float $high [, int $channel = Imagick::CHANNEL_ALL ] )

<?php 
$im 
= new Imagick($input); 
$im->randomThresholdImage5005000 );
$im->writeImage"randomThresholdImage.jpg" );
$im->destroy();
 
?>


The result is a high-contrast, two color image.
Read image
Reads image from filename.
None

Read image blob
Reads image from a binary string.
None

Read image file
Reads image from open filehandle
None

Recolor image
Translate, scale, shear, or rotate image colors.
None


bool recolorImage ( array $matrix )

<?php /*
$matrix = array( '1 0 0 0, 0, 0.5', '0 1 0 0, 0, 0', '0 0 1 0, 0, 0', '0 0 0 1, 0, 0', '0 0 0 0, 1, 0', '0 0 0 0, 0, 1');
$im = new Imagick($input);
$im->recolorImage( $matrix );
$im->writeImage('recolorImage.jpg'); 
$im->destroy();
*/ 
?>


This method supports variable sized matrices but normally 5x5 matrix is used for RGBA and 6x6 is used for CMYK. The last row should contain the normalized values. Not working as expected - getting errors
Reduce noise image
Smooths the contours of an image while still preserving edge information.
Reduce noise image example

bool reduceNoiseImage ( float $radius )

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


The algorithm works by replacing each pixel with its neighbor closest in value. A neighbor is defined by radius. Use a radius of 0 and reduceNoiseImage() selects a suitable radius for you.
Remap image
Replaces colors an image with those defined by replacement.
Remap image example

public bool remapImage ( Imagick $replacement , int $DITHER )

<?php 
$im 
= new Imagick($input);
$replacement = new Imagick('gradient.png');
$im->remapImage$replacementimagick::DITHERMETHOD_UNDEFINED );
$im->writeImage"remapImage.jpg" );
$im->destroy();
 
?>


The colors are replaced with the closest possible color.
Remove image
Removes an image from the image list.
None

Remove image profile
Removes the named image profile and returns it.
None

Render
Renders all preceding drawing commands.
None

Resample image
Resample image to desired resolution.
None

Reset image page
The page definition as a string.
None



The string is in format WxH+x+y
Resize image
Scales an image to the desired dimensions with a filter.
Resize image example

bool resizeImage ( int $columns , int $rows , int $filter , float $blur [, bool $bestfit = false ] )

<?php 
$im 
= new Imagick($input);
$im->resizeImage100100imagick::FILTER_LANCZOSTRUE );
$im->writeImage('resizeImage.jpg'); 
$im->destroy();
 
?>


The filter is optional as Imagick will pick the best filter to use when increasing or decreasing size.
Roll image
Offsets an image as defined by x and y.
Roll image example

bool rollImage ( int $x , int $y )

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