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: 14

Mosaic images

Inlays an image sequence to form a single coherent picture.


( It returns a wand with each image in the sequence composited at the location defined by the page offset of the image. )

Motion blur image

Simulates motion blur.

Motion blur image example
$im = new Imagick($input);
$im->motionBlurImage( 1, 2, 30);
$im->writeImage('motionBlurImage.jpg'); 
$im->destroy();

( We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and MotionBlurImage() selects a suitable radius for you. Angle gives the angle of the blurring motion. )

Negate image

Negates the colors in the reference image.

Negate image example
$im = new Imagick($input);
$im->negateImage(FALSE);
$im->writeImage('negateImage.jpg'); 
$im->destroy();

( The Grayscale option means that only grayscale values within the image are negated. )

New image

Creates a new image and associates ImagickPixel value as background color

New image example
$im = new Imagick();
$im->newImage(200, 150, new ImagickPixel('red'));
$im->writeImage('newImage.jpg'); 
$im->destroy();

Newpseudo image

Creates a new image using ImageMagick pseudo-formats.

Newpseudo image example
$im = new Imagick();
$im->newPseudoImage(200, 150, 'radial-gradient:#000000-#ffffff');
$im->writeImage('newPseudoImage.jpg'); 
$im->destroy();

Next image

Associates the next image in the image list with an Imagick object.

Normalize image

Enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available.

Normalize image example
$im = new Imagick($input);
$im->normalizeImage();
$im->writeImage('normalizeImage.jpg'); 
$im->destroy();

Oil paint image

Applies a special effect filter that simulates an oil painting.

Oil paint image example
$im = new Imagick($input);
$im->oilPaintImage( 2 );
$im->writeImage('oilPaintImage.jpg'); 
$im->destroy();

( Each pixel is replaced by the most frequent color occurring in a circular region defined by radius. )

Opaque paint image

Changes any pixel that matches color with the color defined by fill.

Opaque paint image example
$im = new Imagick($input);
$im->opaquePaintImage( '#850d17', Blue, 20, FALSE );
$im->writeImage('opaquePaintImage.jpg'); 
$im->destroy();

( Not working as expected )

Optimize image layers

Compares each image the GIF disposed forms of the previous image in the sequence.


( From this it attempts to select the smallest cropped image to replace each frame, while preserving the results of the animation. )

Ordered posterize image

Performs an ordered dither based on a number of pre-defined dithering threshold maps.

Ordered posterize image example
$im = new imagick( $image );
$im->orderedPosterizeImage('h8x8a');
$im->setImageFormat('png');
$im->writeImage('orderedPosterizeImage.jpg'); 
$im->destroy();

( But over multiple intensity levels, which can be different for different channels, according to the input arguments. )

Paint floodfill image

Changes the color value of any pixel that matches target and is an immediate neighbor.


( As of ImageMagick 6.3.8 this method has been deprecated and floodfillPaintImage() should be used instead. )

Paint opaque image

Changes any pixel that matches color with the color defined by fill.

Paint opaque image example
$im = new Imagick($input);
$im->paintOpaqueImage( 'Red', 'Orange', 15 );
$im->writeImage('paintOpaqueImage.jpg'); 
$im->destroy();

( NOT WORKING )

Paint transparent image

Changes any pixel that matches color with the color defined by fill.

Paint transparent image example
$im = new Imagick($input);
$im->paintTransparentImage('rgb(108,5,9)', 0.5, 6000);
$im->writeImage('paintTransparentImage.png'); 
$im->destroy();

( The fuzz is not a percent )