imagick

Make white transparent on the outside only

痴心易碎 提交于 2019-12-12 15:41:53
问题 I am using imagick with php to modify uploaded images. I want to remove the white around an image to make it have a transparent background. Using this: $val = 65535/15; $val = intval($val/1);//divide by 1 means accept full fuzz at the moment $image->paintTransparentImage("rgb(255,255,255)", 0.0, intval(1*$val); However, if I upload a picture of someone with white teeth, it makes their teeth vanish! So am i missing something that I could do to prevent that or should I just drop the idea? 回答1:

ImagickException with message Postscript delegate failed on MAMP 3.0.5

╄→尐↘猪︶ㄣ 提交于 2019-12-12 15:28:02
问题 Im trying to convert a PDF to a png file using MAMP 3.0.5. I know that my PHP code works as it works fine on our Linux server... I have setup MAMP 3.0.5 on my Mac OSX 10.8.5 and when I run the script to convert the PDF to png file I get the following error: Fatal error: Uncaught exception 'ImagickException' with message 'Postscript delegate failed `/Applications/MAMP/htdocs/timesheets.com/saas/public_html/timesheets1/timesheets/Daisy_Morris_53635951154c7.pdf': No such file or directory @

Imagemagick chop 30px off each edge (variable width and height)

白昼怎懂夜的黑 提交于 2019-12-12 15:12:54
问题 I need to chop 30px off each side (top bottom left right). I've tried crop and also -chop 30x30 but that only seems to work on one side; convert -verbose -density 150 -trim pdfs/test/test.pdf -quality 80 -chop 30x30 images/agents/test/temp/test.jpg 回答1: If it's an even amount on both sides of a dimension, then the command you want is -shave convert -verbose -density 150 -trim pdfs/test/test.pdf -quality 80 -shave 30x30 images/agents/test/temp/test.jpg 来源: https://stackoverflow.com/questions

PHP imagick detect transparency

北城余情 提交于 2019-12-12 09:35:39
问题 I want to be able to detect whether an image is transparent or not using the Imagick PHP extension. So far, the only luck I've been having is to run the exec() / some other command, and use the ImageMagick command line tool to achieve this. Here's what I mean: exec("identify -verbose example_transparent_image.png | grep \"Alpha\"", $output); $is_transparent = !empty($output) ? true : false; The logic is simple. Do a verbose check on the image in question: if the output contains any alpha

php,unix command ,imagick ,overflow

↘锁芯ラ 提交于 2019-12-12 06:46:46
问题 This is Add text to image echo system('convert mug.jpg -font courier -fill green -pointsize 30 -annotate +100+230 \'hi Wlecome yy\' mug123.jpg'); unix command run in php it is working fine when we change the point size hi welcome is over flow the image how can we over come? 回答1: You want a large line of text on top of a small image? I'd expect it to overflow. You could put two lines of text one below the other. However, since you're doing this in PHP, I'd recommend you use an image library

php - how to find coordinates of edges in an image using imagick or other library?

吃可爱长大的小学妹 提交于 2019-12-12 05:03:28
问题 given an image composed of a plain black field with a single white rectangle inside it somewhere, how can i extract the coordinates of the rectangle ? i've googled and googled and found numerous articles on edge detection using hough lines, convolution, morphology, etc., but all of these actually edge the image or convert it in some way. i don't want to change the image, all i want to do is find where the edges are. obviously, i could simply iterate over the entire width+height of the image

Optimizing Imagick annotateImage

本秂侑毒 提交于 2019-12-12 04:54:49
问题 I'm generating images of text using Imagick (think site banners - they look like that). I'm running out of resources on the server in this function, specifically the annotate line. public function output_image($type = 'png') { $this->set_draw($this->font_size); $this->image->newImage($this->width*1.3, $this->line_height*2.5, 'transparent'); // make an image that's too big $this->image->annotateImage($this->draw, $this->font_size*0.5, //x offset for cursive fonts $this->font_size, // vertical

How to install decode delegate for Imagick in Xampp on Windows

拥有回忆 提交于 2019-12-12 04:41:51
问题 I've gone through many post related to the installation of Imagick and the decode delegates. But most of them were only based on a Linux environment. I'm working on Xampp (Xampp 1.8.1 and PHP Version 5.4.7) in a Windows environment. I'm not used to these commands. How can I install the decode delegates for Imagick. I am also seeking a way to check the status of these components (whether it is installed or not). 来源: https://stackoverflow.com/questions/32442085/how-to-install-decode-delegate

ImageMagick on Ubuntu 14.04 No decode delegate

为君一笑 提交于 2019-12-12 03:39:09
问题 In development enviroment works but not in production enviroment. Production enviroment error: $e->getMessage(): "no decode delegate for this image format '/tmp/sws5725c638311df5.24370631' @ error/svg.c/ReadSVGImage/2871" Generate tmpname: $tmpname = '/tmp/'.uniqid('sws', true); Method: public function load($filename) { try { $this->filename = $filename; $this->image = new Imagick($filename); return $this; } catch(ImagickException $e) { error_log($e->getMessage(), 3, "/tmp/log.log");

PHP Imagick's setFont method take too long time to execute

一曲冷凌霜 提交于 2019-12-12 02:18:51
问题 I got a very weird problem in my PHP environment using Imagick: My environment is like this: Darwin 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64 PHP 7.0.16 (cli) (built: Feb 16 2017 22:57:49) ( NTS ) imagick module version => 3.4.3RC4 imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel Imagick compiled with ImageMagick version => ImageMagick 6.9.7-6 Q16 x86_64 2017-02-01 http://www