Two-dimensional code example using Imagick drawing text for wrapping

Source: Internet
Author: User
Tags manual explode image processing library mixed php file sprintf


Two-dimensional code generation using the QRCode library: http://phpqrcode.sourceforge.net/

The most annoying thing is the word line, processing functions from the network.

The function used in the following code is incomplete, the complete code uploads github: Https://github.com/zhoumengkang/imagick-demo
The template diagram and the effect diagram are as follows:

Imagick drawing word wrapping to generate two dimensional code

function Createusercard ($username, $num, $desc, $id, $url) {


Error_reporting (E_all);


Ini_set ("Display_errors", "on");


Create a new blank picture to make a canvas


$canvas = new Imagick;


$canvasWidth = 588;


$canvasHeight = 684;


$canvas->newimage ($canvasWidth, $canvasHeight, ' White ');


$canvas->setimageformat (' jpg ');





$fontFile = Font_path. " /msyh.ttf ";


$fontSize = 20;


Cover


$face = new Imagick ();


$face->readimageblob (Curl_get ($url)); Read the picture inside the URL


$face->cropthumbnailimage (200, 200);





Reading pictures


$pic = new Imagick;


$QRcodeFile = Createqrcode ($id, "M");


$pic->readimage ($QRcodeFile);


$codeWith = 256;


$pic->cropthumbnailimage ($codeWith, $codeWith);





Background picture


$background = new Imagick;


$background->readimage ("/data0/logs/static/user/template.png");





Merge pictures into canvas


$canvas->compositeimage ($face, Imagick::composite_over, 194, 0);


$canvas->compositeimage ($pic, Imagick::composite_over, ($canvasWidth-$codeWith)/2, $canvasHeight-$codeWith-31) ;


$canvas->compositeimage ($background, imagick::composite_over, 0, 0);








$draw = new Imagickdraw;


$draw->setfont ($fontFile);


$draw->setfontsize ($fontSize);


$draw->setfillcolor (New Imagickpixel (' #000000 '));


$draw->settextalignment (Imagick::align_center);


$canvas->annotateimage ($draw, $canvasWidth/2, 230,0, $username);








$desc = AutoWrap ($fontSize, $fontFile, $desc, 460);


$draw->setfont ($fontFile);


$draw->setfontsize ($fontSize);


$draw->setfillcolor (New Imagickpixel (' #000000 '));


$draw->settextalignment (Imagick::align_center);


$canvas->annotateimage ($draw, $canvasWidth/2, 310,0, $DESC);








$draw->setfont ($fontFile);


$draw->setfontsize ($fontSize);


$draw->setfillcolor (New Imagickpixel (' #E23B3B '));


$draw->settextalignment (Imagick::align_left);


$canvas->annotateimage ($draw, 290, 275,0, $num);





$draw->setfont ($fontFile);


$draw->setfontsize ($fontSize);


$draw->setfillcolor (New Imagickpixel (' #ffffff '));


$draw->settextalignment (Imagick::align_center);


$canvas->annotateimage ($draw, $canvasWidth/2, $canvasHeight -20,0, "Come to me to play, first long by the identification of two-dimensional code");





Save a picture to another directory


$userCardPath = "/data0/logs/static/user";


$canvas->writeimage ($userCardPath.) /". $id.". JPG ");


}


Createusercard ("Zhou Mengkang", 6376, "What the hell is JR Smith doing?" The last minute burst, to explode you early Ah, the championship give a person ", 2," http://f10.topitme.com/l/201005/17/ 12740893805467.jpg ");


Example 2

$towidth = ' 500 ';


$toheight = ' 700 '; Set the maximum width and height allowed when a picture is resized


$sourcefile = './b.jpg '; Define an image file path


$image->writeimage ('./b.jpg.bak '); You can back up this picture


$myimage = new Imagick ($sourcefile); Read the image file


$exifobject = My_exif ($myimage); Self-write function, read EXIF information (shoot data), arrange EXIF information according to their own requirements, return the object


$myimage->setimageformat (' jpeg '); Convert picture to JPG format


$myimage->setcompressionquality (100); Set JPG compression quality, 1-100


$myimage->enhanceimage (); Go to the noise.


$sourcewidth = $myimage->getimagewidth (); Get the original size of the read image


if ($sourcewidth > $towidth)


{


$myimage->scaleimage ($towidth, $toheight, true); Resize a picture


}


$myimage->raiseimage (8, 8, 0, 0, 1); Plus semitransparent border


$resizewidth = $myimage->getimagewidth (); Read the size of the picture after the adjustment


$resizeheight = $myimage->getimageheight ();


$drawback = new Imagickdraw (); Instantiate a drawing object, draw a semitransparent black background to use for EXIF information


$drawback->setfillcolor (New Imagickpixel (' #000000 ')); Set fill color to black


$drawback->setfillopacity (0.6); Fill transparency is 0.6, parameter 0.1-1,1 is opaque


$drawback->rectangle ($resizewidth/2-190, $resizeheight -50, $resizewidth/2 + 190, $resizeheight-12); Draws the rectangle parameter, which is the upper-left corner x, y, lower-right corner x, y


$myimage->drawimage ($drawback); Confirm that the rectangle is drawn in image


$draw = new Imagickdraw (); Instantiate a drawing object, and draw Exif text information embedded in the picture


$draw->setfont ('./xianhei.ttf '); Set text font, require TTF or TTC font, can be absolute or relative path


$draw->setfontsize (11); Set Font size


$draw->settextalignment (2); Text alignment, 2 centered


$draw->setfillcolor (' #FFFFFF '); Text Fill Color


$myimage->annotateimage ($draw, $resizewidth/2, $resizeheight -39, 0, $exifobject->row1); Draw the first line of text, centered


$myimage->annotateimage ($draw, $resizewidth/2, $resizeheight -27, 0, $exifobject->row2); Draw second line of text, centered


$myimage->annotateimage ($draw, $resizewidth/2, $resizeheight -15, 0, $exifobject->row3); Draw the third line of text, centered


/* Output the image with headers * *


Header (' Content-type:image/jpeg '); PHP file output MIME type is JPEG picture


Echo $myimage; Output picture in current PHP page


$image->writeimage ('./b.new.jpg '); If the picture does not need to be output in the current PHP program, use the write picture to the disk function, the above setting header can also be removed


$myimage->clear ();


$myimage->destroy (); Releasing resources


Self-write function, read EXIF information, return object


function My_exif ($myimage)


{


$exifArray = Array (' Exif:model ' => ' unknown ', ' exif:datetimeoriginal ' => ' unknown ', ' exif:exposureprogram ' => ' unknown ', ' EXIF: Fnumber ' => ' 0/10 ', ' exif:exposuretime ' => ' 0/10 ', ' exif:isospeedratings ' => ' unknown ',


' Exif:meteringmode ' => ' unknown ', ' exif:flash ' => ' Turn off flash ', ' exif:focallength ' => ' unknown ', ' exif:exifimagewidth ' => ' not Know ', ' exif:exifimagelength ' => ' unknown '); Initializing part of the information to prevent errors in the operation when the photo EXIF information cannot be read


$exifArray = $myimage->getimageproperties ("exif:*"); Read the EXIF information of the picture and save it in the $exifarray array


If you need to display the original array you can use Print_r ($exifArray);


$r->row1 = ' camera: '. $exifArray [' Exif:model '];


$r->row1 = $r->row1. ' Shoot time: '. $exifArray [' exif:datetimeoriginal '];


Switch ($exifArray [' Exif:exposureprogram '])


{


Case 1:


$exifArray [' exif:exposureprogram '] = "Manual (M)";


Break Manual Control


Case 2:


$exifArray [' exif:exposureprogram '] = "program Automatic (P)";


Break Program Normal


Case 3:


$exifArray [' exif:exposureprogram '] = "aperture first (A,AV)";


Break Aperture Priority


Case 4:


$exifArray [' exif:exposureprogram '] = "Shutter priority (S,TV)";


Break Shutter Priority


Case 5:


$exifArray [' exif:exposureprogram '] = "slow shutter";


Break Program Creative (Slow)


Case 6:


$exifArray [' exif:exposureprogram '] = "movement mode";


Break Program Action (high-speed)


Case 7:


$exifArray [' exif:exposureprogram '] = "Portrait";


Break Portrait


Case 8:


$exifArray [' exif:exposureprogram '] = "Landscape";


Break Landscape


Default


$exifArray [' exif:exposureprogram '] = "other";


}


$r->row1 = $r->row1. ' Mode: '. $exifArray [' Exif:exposureprogram '];


$exifArray [' exif:fnumber '] = explode ('/', $exifArray [' Exif:fnumber ']);


$exifArray [' exif:fnumber '] = $exifArray [' Exif:fnumber '][0]/$exifArray [' Exif:fnumber '][1];


$r->row2 = ' aperture: f/'. $exifArray [' Exif:fnumber '];


$exifArray [' exif:exposuretime '] = explode ('/', $exifArray [' exif:exposuretime ']);


if ($exifArray [' exif:exposuretime '][0]/$exifArray [' Exif:exposuretime '][1]) >= 1)


{


$exifArray [' exif:exposuretime '] = sprintf ("%.1fs", (float) $exifArray [' Exif:exposuretime '][0]/$exifArray [' EXIF: Exposuretime '][1]);


} else


{


$exifArray [' exif:exposuretime '] = sprintf ("1/%ds", $exifArray [' Exif:exposuretime '][1]/$exifArray [' EXIF: Exposuretime '][0]);


}


$r->row2 = $r->row2. ' Shutter: '. $exifArray [' Exif:exposuretime '];


$r->row2 = $r->row2. ' ISO: '. $exifArray [' exif:isospeedratings '];


$exifArray [' exif:exposurebiasvalue '] = explode ("/", $exifArray [' Exif:exposurebiasvalue ']);


$exifArray [' exif:exposurebiasvalue '] = sprintf ("%1.1fev", (float) $exifArray [' Exif:exposurebiasvalue '][0]/$ exifarray[' Exif:exposurebiasvalue '][1] * 100)/100);


if ((float) $exifArray [' Exif:exposurebiasvalue '] > 0)


{


$exifArray [' exif:exposurebiasvalue '] = "+". $exifArray [' Exif:exposurebiasvalue '];


}


$r->row2 = $r->row2. ' Compensation: '. $exifArray [' Exif:exposurebiasvalue '];


Switch ($exifArray [' Exif:meteringmode '])


{


Case 0:


$exifArray [' exif:meteringmode '] = "Unknown";


Break


Case 1:


$exifArray [' exif:meteringmode '] = "Matrix";


Break


Case 2:


$exifArray [' exif:meteringmode '] = "central emphasis average";


Break


Case 3:


$exifArray [' exif:meteringmode '] = "point metering";


Break


Case 4:


$exifArray [' exif:meteringmode '] = "multi-point metering";


Break


Default


$exifArray [' exif:meteringmode '] = "other";


}


$r->row2 = $r->row2. ' Photometric: '. $exifArray [' Exif:meteringmode '];


Switch ($exifArray [' Exif:flash '])


{


Case 1:


$exifArray [' exif:flash '] = "Turn on the Flash";


Break


}


$r->row2 = $r->row2. ' ' . $exifArray [' Exif:flash '];


if ($exifArray [' exif:focallengthin35mmfilm '])


{


$r->row3 = ' equivalent focal length: '. $exifArray [' Exif:focallengthin35mmfilm ']. "MM";


} else


{


$exifArray [' exif:focallength '] = explode ("/", $exifArray [' exif:focallength ']);


$exifArray [' exif:focallength '] = sprintf ("%4.1FMM", (double) $exifArray [' Exif:focallength '][0]/$exifArray [' EXIF: Focallength '][1]);


$r->row3 = ' focal length: '. $exifArray [' exif:focallength '];


}


$r->row3 = $r->row3. ' Raw pixel: '. $exifArray [' Exif:exifimagewidth ']. ' X '. $exifArray [' Exif:exifimagelength ']. ' PX ';


if ($exifArray [' Exif:software '])


{


$r->row3 = $r->row3. ' Late: '. $exifArray [' Exif:software '];


}


return $r;


}

Example 3


<?php
Get a watermark Picture
$logo = new Imagick ("Logo.png");
$logo->setimageresolution (0.01,0.03);

Create a Imagick object and get the source diagram to process
$im = new Imagick ("old_large_img_2.jpg");

Get source picture width and height
$srcWH = $im->getimagegeometry ();

Picture equal scale shrink relaxed and high setting
if ($srcWH [' width ']>710] {
$srcW [' width '] = 710;
$srcH [' height '] = $srcW [' width ']/$srcWH [' width ']* $srcWH [' height '];
}else{
$srcW [' width '] = $srcWH [' width '];
$srcH [' height '] = $srcWH [' height '];
}

Scale by scale
$im->thumbnailimage ($srcW [' width '], $srcH [' Height '], true);

Create a picture with a color according to the thumbnail size
$canvas = new Imagick ();
$canvas->newimage ($srcW [' width '], $srcH [' Height '], ' black ', ' jpg '); Pink,black

Add watermark
$im->compositeimage ($logo, Imagick::composite_over, $srcW [' Width ']-280, $srcH [' Height ']-77);
$canvas->setcompressionquality (91);
Merging pictures
$canvas->compositeimage ($im, imagick::composite_over, 0, 0);

Output picture
Header ("content-type:image/jpg");
Echo $canvas;

Generate pictures
$canvas->writeimage ("test_img/old_large_img_2_96.jpg");
?>

Imagick is a powerful image processing library.

Translation is actually a brief introduction to the main functions of Imagick or the introduction of functional functions that I think are more practical and examples of use.

Because my English proficiency is limited, so use more popular or more close to the application of language to describe.

First, enjoy a group of bright effects:

Offset Image:

Example:

<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->rollimage (20,39);
Echo $image;
?>

Thumbnailimage ($width, $height) Change picture size
Example:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->thumbnailimage (100,0);
Echo $image;
?>

Addnoiseimage (int $noise _type [, int $channel = Imagick::channel_all]);
Function:
Adds random noise to the image
Add interferon

Noise Constants ($noise _type type)


Imagick::noise_uniform (integer)


Imagick::noise_gaussian (integer)


Imagick::noise_multiplicativegaussian (integer)


Imagick::noise_impulse (integer)


Imagick::noise_laplacian (integer)


Imagick::noise_poisson (integer)


Channel Constants ($channel type)


imagick::channel_undefined (integer)


Imagick::channel_red (integer)


Imagick::channel_gray (integer)


Imagick::channel_cyan (integer)


Imagick::channel_green (integer)


Imagick::channel_magenta (integer)


Imagick::channel_blue (integer)


Imagick::channel_yellow (integer)


Imagick::channel_alpha (integer)


Imagick::channel_opacity (integer)


Imagick::channel_matte (integer)


Imagick::channel_black (integer)


Imagick::channel_index (integer)


Imagick::channel_all (integer)


Example:


&lt;?php


Ini_set (' display_errors ', 1);


Header (' Content-type:image/jpeg ');


$image = new Imagick (' 1.jpg ');


$image-&gt;thumbnailimage (100,0);


$image-&gt;addnoiseimage (imagick::noise_poisson,imagick::channel_opacity);


Echo $image;


?&gt;

Annotateimage Create a text image
Example:
<?php
$image = new Imagick ();
$draw = new Imagickdraw ();
$pixel = new Imagickpixel (' Gray ');
$image->newimage (A, $pixel);
$pixel->setcolor (' black ');
$draw->setfont (' bookman-demiitalic ');
$draw->setfontsize (30);
$image->annotateimage ($draw, ten, 0, ' The quick brown fox jumps over the lazy dog ');
$image->setimageformat (' png ');
Header (' content-type:image/png ');
Echo $image;
?>

Blurimage (float $radius, float $sigma [, int $channel])
Fuzzy degree processing of Adds blur filter to image image
Parameters:
int $channel:
imagick::channel_undefined (integer)
Imagick::channel_red (integer)
Imagick::channel_gray (integer)
Imagick::channel_cyan (integer)
Imagick::channel_green (integer)
Imagick::channel_magenta (integer)
Imagick::channel_blue (integer)
Imagick::channel_yellow (integer)
Imagick::channel_alpha (integer)
Imagick::channel_opacity (integer)
Imagick::channel_matte (integer)
Imagick::channel_black (integer)
Imagick::channel_index (integer)
Imagick::channel_all (integer)

<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->blurimage (5,3);
Echo $image;
?>


Borderimage (mixed $bordercolor, int $width, int $height) picture border processing
Example:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$color =new Imagickpixel ();
$color->setcolor ("RGB (220,220,220)");
$image->borderimage ($color, 5,4);

$image->blurimage (5,5,imagick::channel_green);
Echo $image;
?>

Charcoalimage (float $radius, float $sigma) Image sketch Processing
Parameter description:
$radius: The smaller the thinner.
$sigma: The greater the ink the deeper the contrary.
Example:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$color =new Imagickpixel ();
$color->setcolor ("RGB (220,220,220)");
$image->borderimage ($color, 5,4);
$image->charcoalimage (0.0001,0.001);
$image->blurimage (5,5,imagick::channel_green);
Echo $image;
?>

Chopimage (int $width, int $height, int $x, int $y)
Parameter Description: Delete a range of image areas
Do not do parameter description, a look will know.

Colorizeimage (mixed $colorize, mixed $opacity) mixed fill color
$colorize Color
$opacit Transparency
Example:
<?php
/*
Film Negative effect
*/
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->negateimage (FALSE);
$image->colorizeimage (' #000 ', 1.0);
Echo $image;
?>

Embossimage (float $radius, float $sigma)
Function: Returning a grayscale 3D image is not very good.
Example:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->embossimage (1,1);
Echo $image;
?>

(Two photo effect chart)

Flipimage (void)
Function: Create image reflection (flip vertically)
Example:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->flipimage ();
Echo $image;
?>

Flopimage (void)
Function: Horizontal flip of image horizontally
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->flopimage ();
Echo $image;
?>

Frameimage (mixed $matte _color,int $width, int $height, int $inner _bevel, int $outer _bevel)
Function: Create a 3D image border
Parameter description:
$matte _color: Color
$inner _bevel: Internal tilt of border
$outer _bevel: Tilt of outer border
Example:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$color =new Imagickpixel ();
$color->setcolor ("RGB (220,220,220)");
$image->frameimage ($color, 11,11,1,10);
Echo $image;
?>


Precautions:
$width (width) cannot be less than $inner_bevel (gradient inside border)

Imagick::gammaimage (float $gamma [, int $channel = Imagick::channel_all])
Function: Adjust the image gray factor
Parameter description:
Float $gamma: Gray factor value
$channel defaults to Imagick::channel_all
Imagick::channel_all
Example 1:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->gammaimage (30);
Echo $image;
?>

Example 2:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->gammaimage (30);
Echo $image;
?>

Gaussianblurimage (float $radius, float $sigma [, int $channel = Imagick::channel_all])
Function: Gaussian blur process is similar to photo Gaussian Blur
Parameter description:
Float $radius: Gaussian blur radius, pixel, excluding central pixel.
Float $sigma: The standard deviation of Gauss, in pixels. I think this parameter is the most important.
int $channel: Image color mode.
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->gaussianblurimage (30,3);
Echo $image;
?>

Levelimage (float $blackPoint, float $gamma, float $whitePoint [, int $channel = Imagick::channel_all])
Function: Adjust the color levels of the image (adjusts the levels of an)
Parameter description

<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->levelimage (4,4,4);
Echo $image;
?>

Example 2:

<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->levelimage (200,200,200,imagick::channel_green);
Echo $image;
?>

Magnifyimage (void)
Function Description: Simple image magnification twice times (is a convenience method this scales an image proportionally to twice its original size.)
Example:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->magnifyimage ();
Echo $image;
?>

Medianfilterimage (float $radius)
Feature: Special Yes filter sort of like Photoshop toner filter
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$color =new Imagickpixel ();
$color->setcolor ("RGB (220,220,220)");
$image->medianfilterimage (5);
Echo $image;
?>

Minifyimage (void)

function: Figure small shrink One times (scales an image proportionally to half its size)
Example:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->minifyimage ();
Echo $image;
?>

Modulateimage (float $brightness, float $saturation, float $hue)
Function: Control the brightness, saturation and hue of the adjusted image.
Parameter description:
Float $brightness: Brightness
Float $saturation: Saturation
Float $hue Hue
Example 1:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->modulateimage (100,1,100);
Echo $image;
?>

Example 2:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$image->modulateimage (250,1,250);
Echo $image;
?>

Motionblurimagemotionblurimage (float $radius, float $sigma, float $angle [, int $channel = Imagick::channel_default])
Function: Simulate motion blur (simulates motion blur), like Photoshop dynamic blur filter function
Parameter description:
Float $radius: Gaussian radius, not wrapped in central pixel.
Float $sigma: Gauss of the standard deviation, in pixels. "Important Parameters"
Float $angle: Fuzzy angle.
int $channel: Image color mode. Default is Imagick::channel_default
Example 1:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$color =new Imagickpixel ();
$color->setcolor ("RGB (220,220,220)");
$image->motionblurimage (61,10,10);
Echo $image;
?>

Example 2:

<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$color =new Imagickpixel ();
$color->setcolor ("RGB (220,220,220)");
$image->motionblurimage (201,10,100);
Echo $image;
?>

Oilpaintimage (float $radius):
Function Description: Analog oil painting filter (simulates an painting)
Example:
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$color =new Imagickpixel ();
$color->setcolor ("RGB (220,220,220)");
$image->oilpaintimage (1);
Echo $image;
?>

Radialblurimage (float $angle [, int $channel = Imagick::channel_all])
Function: Radial blur (radial blurs an image)
<?php
Ini_set (' display_errors ', 1);
Header (' Content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$color =new Imagickpixel ();
$color->setcolor ("RGB (220,220,220)");
$image->radialblurimage (30);
Echo $image;
?>

Raiseimage (int $width, int $height, int $x, int $y, bool $raise)
Feature Description: Create 3D image button (creates a simulated 3d button -like effect)
<?php
Ini_set (' display_errors ', 1);
Header (' content-type:image/jpeg ');
$image = new Imagick (' 1.jpg ');
$color =new imagickpixel ();
$color->setcolor ("RGB (220,220,220)");
$image->raiseimage (10,10,3,5,6);
Echo $image;
?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.