# Functions page: 21

 Shear image Slides one edge of an image along the X or Y axis, creating a parallelogram. bool shearImage ( mixed \$background , float \$x_shear , float \$y_shear )``` shearImage( new ImagickPixel( 'none' ), 10, 0 ); \$im->writeImage('shearImage.png');  \$im->destroy(); ?> ```An X direction shear slides an edge along the X axis, while a Y direction shear slides an edge along the Y axis. The amount of the shear is controlled by a shear angle. For X direction shears, x_shear is measured relative to the Y axis, and similarly, for Y direction shears y_shear is measured relative to the X axis. Empty triangles left over from shearing the image are filled with the background color. sigmoidalContrastImage Adjusts the contrast of an image with a non-linear sigmoidal contrast algorithm. bool sigmoidalContrastImage ( bool \$sharpen , float \$alpha , float \$beta [, int \$channel = Imagick::CHANNEL_ALL ] )``` sigmoidalContrastImage( 0.8, 1, 1 ); \$im->writeImage('sigmoidalContrastImage.jpg');  \$im->destroy();  ?> ```Increase the contrast of the image using a sigmoidal transfer function without saturating highlights or shadows. Contrast indicates how much to increase the contrast (0 is none; 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in the resultant image (0 is white; 50 is middle-gray; 100 is black). Set sharpen to TRUE to increase the image contrast otherwise the contrast is reduced. Sketch image Simulates a pencil sketch. bool sketchImage ( float \$radius , float \$sigma , float \$angle )``` sketchImage( 10, 0, 45 ); \$im->writeImage('sketchImage.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 Imagick::sketchImage() selects a suitable radius for you. Angle gives the angle of the blurring motion. solarizeImage Applies a special effect to the image, similar to the effect achieved in a photo darkroom by selectively exposing areas of photo sensitive paper to light. bool solarizeImage ( int \$threshold )``` solarizeImage( 2000 ); \$im->writeImage('solarizeImage.jpg');  \$im->destroy();  ?> ```Threshold ranges from 0 to QuantumRange and is a measure of the extent of the solarization. Sparse color image Interpolates colors Untested - documentation seems wrong for the array. public bool sparseColorImage ( int \$SPARSE_METHOD , array \$arguments [, int \$channel = Imagick::CHANNEL_DEFAULT ] )``` sparseColorImage( Imagick::SPARSECOLORMETHOD_BARYCENTRIC, array( 0, 0, black, 0, 20, white ) ); */ ?> ```Given the arguments array containing numeric values this method interpolates the colors found at those coordinates across the whole image using sparse_method. Splice image Splices a solid color into the image bool spliceImage ( int \$width , int \$height , int \$x , int \$y )``` setImageBackgroundColor('#fad888'); \$im->spliceImage( 20, 20, 100, 75 ); \$im->writeImage('spliceImage.jpg');  \$im->destroy();  ?> ``` Spread image Special effects method that randomly displaces each pixel in a block defined by the radius parameter. bool spreadImage ( float \$radius )``` spreadImage( 10 ); \$im->writeImage('spreadImage.jpg');  \$im->destroy();  ?> ``` Stegano image Hides a digital watermark within the image. None Recover the hidden watermark later to prove that the authenticity of an image. Offset defines the start position within the image to hide the watermark. Stereo image Composites two images None Composites two images and produces a single image that is the composite of a left and right image of a stereo pair. Strip image Strips an image of all profiles and comments. bool stripImage ( void )``` stripImage(); \$im->swirlImage( 100 ); \$im->writeImage('stripImage.jpg');  \$im->destroy();  ?> ``` Swirl image Swirls the pixels about the center of the image. bool swirlImage ( float \$degrees )``` swirlImage( 50 ); \$im->writeImage('swirlImage.jpg');  \$im->destroy();  ?> ```Where degrees indicates the sweep of the arc through which each pixel is moved. You get a more dramatic effect as the degrees move from 1 to 360. Texture image Repeatedly tiles the texture image across and down the image canvas. bool textureImage ( Imagick \$texture_wand )``` textureImage( \$texture ); \$im->writeImage( 'textureImage.png'); \$im->destroy();  ?> ```The texture part is working but the transparency of the texture is being lost. Threshold image Changes the value of individual pixels based on the intensity of each pixel compared to threshold. bool thresholdImage ( float \$threshold [, int \$channel = Imagick::CHANNEL_ALL ] )``` thresholdImage( 5000 ); \$im->writeImage('thresholdImage.jpg');  \$im->destroy();  ?> ```The result is a high-contrast, two color image. Thumbnail image Changes the size of an image bool thumbnailImage ( int \$columns , int \$rows [, bool \$bestfit = false [, bool \$fill = false ]] )``` thumbnailImage( 150, 150, TRUE ); \$im->writeImage( "thumbnailImage.jpg" ); \$im->destroy();  ?> ```Changes the size of an image to the given dimensions and removes any associated profiles. The goal is to produce small low cost thumbnail images suited for display on the Web. If TRUE is given as a third parameter then columns and rows parameters are used as maximums for each side. Both sides will be scaled down until the match or are smaller than the parameter given for the side. Tint image Applies a color vector to each pixel in the image. bool tintImage ( mixed \$tint , mixed \$opacity )``` tintImage( blue, 80 ); \$im->writeImage( "tintImage.jpg" ); \$im->destroy();  ?> ```The length of the vector is 0 for black and white and at its maximum for the midtones. The vector weighing function is f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).