Functions page: 5

Frame image
Adds a simulated three-dimensional border around the image.
Frame image example

bool frameImage ( mixed $matte_color , int $width , int $height , int $inner_bevel , int $outer_bevel )

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


The width and height specify the border width of the vertical and horizontal sides of the frame. The inner and outer bevels indicate the width of the inner and outer shadows of the frame.
Function image
Applies an arithmetic, relational, or logical expression to an image.
My version of Imagick is to old


public bool functionImage ( int $function , array $arguments [, int $channel = Imagick::CHANNEL_DEFAULT ] )

<?php /*
$im->functionImage ( Imagick::FUNCTION_POLYNOMIAL, array( 4, -4, 1 ) );
*/ 
?>


Use these operators to create lighter or darker versions of an image, to increase or decrease contrast in an image, or to negate the image colors.
fx image
Evaluate expression for each pixel in the image.
None



Consult the Fx Special Effects Image Operator for more information.
Gamma image
Gamma-corrects an image.
Gamma image example

bool gammaImage ( float $gamma [, int $channel = Imagick::CHANNEL_ALL ] )

<?php 
$im 
= new Imagick($input);
$im->gammaImage2imagick::CHANNEL_RED );
$im->writeImage('gammaImage.jpg'); 
$im->destroy();
 
?>


The same image viewed on different devices will have perceptual differences in the way the image's intensities are represented on the screen. Specify individual gamma levels for the red, green, and blue channels, or adjust all three with the gamma parameter. Values typically range from 0.8 to 2.3.
God knows how thw channel selection is supposed to work!
Gaussian blur image
Blurs an image.
Gaussian blur image example

bool gaussianBlurImage ( float $radius , float $sigma [, int $channel = Imagick::CHANNEL_ALL ] )

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


We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and selects a suitable radius for you.
Get color as string
Returns the color of the ImagickPixel object as a string.
Get the color as a string: rgb(105,134,6)


getColorAsString ( void )

<?php 
$im 
= new Imagick($input);
$pixel $im->getImagePixelColor7822 );
echo 
'<br>Get the color as a string: '.($pixel->getColorAsString());
$im->destroy();
 
?>
Get color count
Returns the color count associated with this color.
Not working


getColorCount ( void )

<?php 
$im 
= new Imagick($input);
$pixel $im->getImagePixelColor7822 );
echo 
'<br>Color count: '.$pixel->getColorCount();
$im->destroy();
 
?>
Get color value
Retrieves the value of the color channel specified, as a floating-point number between 0 and 1.
Alpha: 1
Opacity: 0
Red value: 105
Green value: 134
Blue value: 6



getColorValue ( int $color )

<?php 
$im 
= new Imagick($input);
$pixel $im->getImagePixelColor7822 );
echo 
'<br>Alpha: '.$pixel->getColorValue(imagick::COLOR_ALPHA);
echo 
'<br>Opacity: '.$pixel->getColorValue(imagick::COLOR_OPACITY);
echo 
'<br>Red value: '.round255 * ($pixel->getColorValue(imagick::COLOR_RED)));
echo 
'<br>Green value: '.round255 * ($pixel->getColorValue(imagick::COLOR_GREEN)));
echo 
'<br>Blue value: '.round255 * ($pixel->getColorValue(imagick::COLOR_BLUE)));
$im->destroy();
 
?>



Get colorspace
Gets the global colorspace value.
My version is to old


int getColorspace ( void )

<?php 
/*
$im = new Imagick($input);
$colorspace = $im->getColorspace();
echo "<br>Image colorspace = $colorspace";
*/
 
?>
Get compression
Gets the object compression type.
Image compression = 0


int getCompression ( void )

<?php 
$im 
= new Imagick($input);
$compression $im->getCompression();
echo 
"<br>Image compression = $compression";
 
?>


imagick::COMPRESSION_UNDEFINED 0
imagick::COMPRESSION_NO 1
imagick::COMPRESSION_BZIP 2
imagick::COMPRESSION_DXT1 3
imagick::COMPRESSION_DXT3 4
imagick::COMPRESSION_DXT5 5
imagick::COMPRESSION_FAX 6
imagick::COMPRESSION_GROUP4 7
imagick::COMPRESSION_JPEG 8
imagick::COMPRESSION_JPEG2000 9
imagick::COMPRESSION_LOSSLESSJPEG 10
imagick::COMPRESSION_LZW 11
imagick::COMPRESSION_RLE 12
imagick::COMPRESSION_ZIP 13

Get compression quality
Gets the object compression quality.
Image compression quality = 0


int getCompressionQuality ( void )

<?php 
$im 
= new Imagick($input);
$compressionQuality $im->getCompression();
echo 
"<br>Image compression quality = $compressionQuality";
 
?>
Get copyright
Returns the ImageMagick API copyright as a string.
Image copyright = Copyright (C) 1999-2009 ImageMagick Studio LLC


string getCopyright ( void )

<?php 
$im 
= new Imagick($input);
$copyright $im->getCopyright ();
echo 
"<br>Image copyright = $copyright";
 
?>
Get filename
Returns the filename associated with an image sequence.
Image filename = /home/usr/public_html/imagemagick/imagick/temp.jpg


string getFilename ( void )

<?php 
$im 
= new Imagick($input);
$filename $im->getImageFilename();
echo 
"Image filename = $filename<br/>";
 
?>
Get font
Returns the objects font property.
Font used is = /home/usr/public_html/imagemagick/imagick/arial.ttf


string getFont ( void )

<?php 
$im 
= new Imagick($input);
$im->setFont("arial.ttf");
$font_used $im->getFont();
echo 
"Font used is = $font_used<br/>";
 
?>
Get format
Returns the format of the Imagick object.
Image format = JPEG


string getFormat ( void )

<?php 
$im 
= new Imagick($input);
$format $im->getImageFormat();
echo 
"Image format = $format<br/>";
 
?>