测试了下 php_imagick 的一些功能希望能对你有用
[code]<?php
//define('PATH',dirname(__FILE__));
//$srcIMG = PATH.'/src.png';
////$srcIMG3 = PATH.'/039.jpg';
////$srcIMG4 = PATH.'/041.jpg';
////$srcIMG = PATH.'/SI851275.JPG';
//$newIMG = PATH.'/newImage.png';
//$img = new Imagick($srcIMG);
////$img->writeImage($newIMG);exit;
//////$img->charcoalImage(1,0.1); // 木炭效果 不错
//////$img->chopImage(100,100,100,100); // 模糊效果 不错
//////$img->commentImage('hello World'); // 添加图片评论
//////echo $img->getImageProperty('comment'); // 读取图片属性
//////$img->cropImage(200,100,200,200); //裁减图片 很有用
//////$img->cropThumbnailImage(1000,1000); // 缩放后居中裁减
//////$img->despeckleImage(); // 去除一些杂点
////
/////* 在上面写字
////$string = 'hello World';
////$draw = new ImagickDraw();
////$draw->setFillColor(new ImagickPixel('blue'));
////$draw->setFontSize(28);
////$metrix = $img->queryFontMetrics($draw, $string);
////$draw->annotation(25,125,$string);
////$img->drawImage($draw);
////*/
////
//////$img->edgeImage(0); // 高亮边缘?
////
//////$img->embossImage(0,0.1 ); // 感觉好像加入光照效果
////
//////$img->enhanceImage(); // 提高图片品质
////
//////$img->equalizeImage(); // 好像增加对比及光照把
////
//////$img->flipImage(); // 垂直翻转把!
////
//////$img->flopImage(); // 水平翻转把!
////
//////$img->frameImage(new ImagickPixel('green'),15,15,2,2);
////
/////* 去色
////$clone = $img->clone();
////$clone = $img->fximage('p{0,0}');
////$img->compositeImage($clone,imagick::COMPOSITE_DIFFERENCE,0,0);
////$img->modulateImage(100, 0 , 0); // 加个3d边框
////*/
////
//////$img->gammaImage(10); // gamma 校正
////
//////$img->gaussianBlurImage(1,1); // 高斯模糊图像
////
//////$img->getCompression(); // 压缩图像?
////
//////$img->getCompressionQuality(); // 压缩图像?
////
//////echo $img->getCopyright(); // 获得版权 Copyright (C) 1999-2007 ImageMagick Studio LLC
////
//////$img->oilPaintImage(3); // 油画效果
//////$img->adaptiveResizeImage(300,300);
//$img->setImageFormat('png');
////$bg = new ImagickDraw();
////$imgs = array($srcIMG2,$srcIMG3,$srcIMG4);
////$img2 = new Imagick($imgs);
////foreach ($img2 as $i){
////$i->thumbnailImage(100,null);
////$i->setImageBackgroundColor( new ImagickPixel( "black" ) );
/////* Use a random angle */
////$angle = mt_rand( 1, 45 );
////if ( mt_rand( 1, 2 ) % 2 === 0 ){
//// $angle = $angle * -1;
////}
////$i->polaroidImage( $bg, $angle );
////$img->compositeImage( $i, Imagick::COMPOSITE_OVER, mt_rand( 10, 350 ), mt_rand( 10, 350 ) );
////}
//////$img2->writeImage($newIMG);
////$img2->removeImage();
//
//
////#
////$draw = new ImagickDraw();
////#
////
////#
/////* Set the fill color to light blue */
////#
////$draw->setFillColor( new ImagickPixel( 'light blue' ) );
////#
////
////#
/////* Create the polaroid image */
////#
////$img->polaroidImage( $draw, 20 );
//
////$img->radialBlurImage(10); // 径向模糊
//
////$img->raiseImage(20,20,10,10,false); // 整个按钮
//
////$img->rotateImage(new ImagickPixel(), 270); // 旋转
////$img->scaleImage(300,300,true); // 感觉像缩放
//
////$img->sepiaToneImage(70); // 深褐色调节?
//
////$img->setCompression(imagick::COMPRESSION_ZIP);
////// a value between 1 and 100, 1 = high compression, 100 low compression
////$img->setCompressionQuality(100);
//
////$img->setImageBias(90); // 不懂
//
////$img->setImageColorspace(3);
//
//
////$img->setImageGamma (10); // 设置gamma效果
////$img->setImageOpacity (0.8); // 设置图像透明
//
////$img->thumbnailImage(500, 0);
////$img->setInterlaceScheme(Imagick::INTERLACE_PLANE);
////$img->charcoalImage(1,0.1);
////$img->sketchImage(10,0.1,5); // 听说素描效果
//
////$img->solarizeImage(100); // 曝光°
//
////$img->spliceImage(100,100,10,10);
////$img->spreadImage(5);
////$img->swirlImage(30); // 旋转扭曲图像
//
////$new_image = $img->transformImage( "500x600", "500x500" );
////$new_image ->writeImage($newIMG);
//
////$img->transposeImage(); // 逆时针旋转 90°
//
////$img->transverseImage(); // 顺时针旋转 90°
//
////$img->vignetteImage(1,1,10,50); // 圆切?
//
////$img->waveImage(10,10); // 浪折
//
//$img->whiteThresholdImage('grey');
//$img->writeImage($newIMG);
//$img->clear();
//$img->destroy();
?>[/code]
附上 最新编译的: PHP 5.2.8 的 php_imagick.dll 下载后放入 ext 目录下 并在 php.ini加入这个扩展
例如:
[code]extension=php_imagick.dll[/code]
[file]attachment/1235449948_0.rar[/file]