imagick

PHP imagick API中文简介

不问归期 提交于 2019-12-04 15:21:47
PHP imagick API中文简介 imagick 类imagick ::adaptiveblurimage 向图像中添加 adaptive 模糊滤镜imagick ::adaptiveresizeimage 自适应调整图像数据依赖关系imagick ::adaptivesharpenimage自适应锐化图像imagick ::adaptivethresholdimage 基于范围的选择为每个像素的亮度imagick ::addimage 图像列表中添加新图像 imagick 对象.imagick ::addnoiseimage 给图像添加随机噪声imagick ::affinetransformimage变换图像imagick ::animateimages 动画图像或图像imagick ::annotateimage annotates 图像的文本imagick ::appendimages 追加一组图像imagick ::averageimages 平均一组图像imagick ::blackthresholdimage 强制所有的像素低于阈值分为黑色imagick ::blurimage 向图像中添加模糊滤镜imagick ::borderimage 四周带有边框的图像imagick ::charcoalimage模拟一个炭笔绘图imagick ::chopimage

php imagick生成gif动画的方法

落爺英雄遲暮 提交于 2019-12-04 15:20:32
>php imagick生成gif动画的方法 <pre> <?php $image=new Imagick(); $animation = new Imagick(); //建立一个对象。 $animation->setFormat( "gif" ); //设置它的类型。 $delay = 30; //设置播放速度。 for ($i=1; $i<52; $i++) { $thisimage = new Imagick(); $thisimage->readImage('testgifimg/frame-'.$i.'.gif'); //我有三个图片分别叫:1.jpg,2.jpg就是要合成他们三个。 $thisimage->setFormat( "gif" ); //把他们都转成GIF格式。 $animation->addImage($thisimage); //加入到刚才建立的那个gif imagick对象之中。 $animation->setImageDelay( $delay ); //设置好播放速度。 } header( "Content-Type: image/gif" ); $animation->writeImages("9.gif",true); //文件存储。不能使用writeImage,因为是多帧的,它会认为是多张图片 </pre> ps

php imagick 获取psd图层信息

别等时光非礼了梦想. 提交于 2019-12-04 15:20:28
php imagick 获取psd图层信息 <pre> <?php $projectname = 'test'; $im = new Imagick("test.psd"); $num_layers = $im->getNumberImages(); for ($i = 1, $num_layers = $im->getNumberImages(); $i < $num_layers; ++$i) { $im->setImageIndex($i); //this $im->setIteratorIndex($i); //or this is kinda redundant $pagedata = $im->getImagePage(); $pagedata['label'] = $im->getImageProperties("*")['label']; $allinfo[] =$pagedata; $im->writeImage($pagedata['label'] . '.png'); //导出所有图层到单独的png文件 } print_r($allinfo); exit(); </pre> 输出数组如下 width是图片宽度 height是图片高度 x和y都是图片相对于容器的位置 label是图层名字 一般用英文 不会乱码 <pre> Array ( [0] => Array

Convert PDF (with transparency *and* CMYK) to jpg

非 Y 不嫁゛ 提交于 2019-12-04 10:58:00
I need to generate jpg images from PDF files (first page only). The PDF files are user generated, so they can contain anything. I'm currently using the following code: // Load PDF. $i = new Imagick; // Create thumbnail of first page of PDF. $i->setResolution(150, 150); $i->loadImage("test.pdf[0]"); $i->thumbnailImage(640, 480, true); // Remove transparency, fill transparent areas with white rather than black. $i->setImageBackgroundColor("white"); $i->setImageAlphaChannel(11); // Imagick::ALPHACHANNEL_REMOVE $i->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN); // Output. $i->writeImage("test.jpg

php imagick设置图片圆角的方法

孤者浪人 提交于 2019-12-04 10:54:31
php imagick设置图片圆角的方法 <pre> header('Content-Type: image/png'); $image = new Imagick('http://static.codeweblog.com/uploads/user/29/58387_100.jpg'); $image->setImageFormat('png'); $image->roundCorners($image->getImageWidth() / 2, $image->getImageHeight() / 2); echo $image; $image->destroy(); </pre> 来源: https://www.cnblogs.com/newmiracle/p/11856300.html

win7 安装php插件imagick

五迷三道 提交于 2019-12-04 10:54:11
    win7 安装php插件imagick   <h2>安装步骤:</h2> <h2><a name="t1"></a><strong>步骤一:先安装好扩展包</strong></h2> 之所以先安装扩展是因为扩展的版本要与软件版本对应,而扩展版本出来的速度比软件版本要慢得多,所以总是没法支持最新版本的软件,因此最好是根据自己安装的扩展来选择安装的ImageMagick软件版本。 <h2><a name="t2"></a>首先Imagic的php扩展包下载地址:http://pecl.php.net/package/imagick</h2> 首先根据你自己的php版本选择,如果不知道自己的版本可以查看phpinfo,下面我截图自己的给个示范: 下面红框标识的地方都是要注意的,最上面是php版本,我的是5.5.30版本的,另外是服务器环境是x86的,也就是32位的,如果这里是64就是64位的,要注意。 <img src="http://img.blog.csdn.net/20170607095115789?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmVsZW5feHVl/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /

php imagick蒙版做法

流过昼夜 提交于 2019-12-04 10:53:41
php imagick蒙版做法 <pre> $image = new \Imagick(); $image->readImage(__DIR__ . '/mengban.png'); $watermark = new \Imagick(); $watermark->readImage(__DIR__ . '/testmengban.jpg'); /*$watermark->scaleImage(750, 1206); *///放到等比例按照宽度缩小图片 按照 $image->compositeImage($watermark, \imagick::COMPOSITE_ATOP, 0, 0); $image->writeImage(__DIR__ . '/mengbanresult.png'); </pre> ps:注意蒙版和最终生成的图片都要png 这个是imagick 其他一些的教程 http://www.netingcn.com/category/imagemagick 来源: https://www.cnblogs.com/newmiracle/p/11856278.html

php imagick svg转成jpg

时间秒杀一切 提交于 2019-12-04 10:53:19
php imagick svg转成jpg <pre> public function svgtojpg() { $image = '<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="400" height="300" viewBox="0,0,40,30" style="border:1px solid #cd0000;" version="1.1" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="40" height="30" fill="#cd0000"/> </svg> '; $filename = 'ef.jpg'; /* $image = stripslashes($_POST['json']); $filename = $_POST['filename'];*/ $unique = time(); $im = new \Imagick(); $im->readImageBlob($image); $res = $im-

Imagick. Changing a color to be transparent

匆匆过客 提交于 2019-12-04 09:43:08
问题 I would like to change the black border of this image : http://dev.loungeup.net/im/ to transparent with Imagick in PHP. The result image should have the gray border visible, the image inside the gray border visible, and everything outside the gray border (today in black) should be transparent and let the underlying content (in HTML page for example) visible. I have been through the documentation several times and tried several solutions but did not figure out how to achieve it. Any help is

Imagick (Imagemagick) Defect in Debian Sqeeze (6)

匆匆过客 提交于 2019-12-04 09:38:24
I have huge troubles running my cakephp application now. after upgrading vom lenny to squeeze (even tried a complete reinstall of sqeeze) imagick is so incredible slow that it simply shuts down my server. I have several image galleries which use imagick to create thumbs. 50 images needed less then 30 seconds (2000x1200 pixel) on lenny. NOW it needs more than an hour.. Processor is at 100% for the complete time making other processes like apache very slow. is this a known bug in squeeze? it is making me crazy! I even tried to run the application of other servers. a friend gave me access to his