php_imagick.dll for php 5.2.8 win ext

php_imagick.dll for php 5.2.8 win ext

<?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( “500×600″, “500×500″ );
$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();
?>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值