imagick

How to use Imagick to merge and mask images?

点点圈 提交于 2019-11-27 10:41:59
I know very little of image processing and even less of the terminology used, so please bear with me. Basically, I want to merge two images together where one of them will act as a mask. That image looks something like this: Where the blue and yellow background are both transparent in reality. This image is being used as a mask for regular photo's. Parts of the photo that 'stick out' of the circle need to be 'cropped' (be made invisible) while the inside remains visible. So everything that comes in the blue area is invisible, everything in the yellow area is visible. I honestly have no clue

Howto: Install Imagick (for php) on Ubuntu 11.10

微笑、不失礼 提交于 2019-11-27 09:56:12
问题 I'm attempting to install ImagicK as its required for a Yii Extension I want to use for my project. I've checked around and followed a few different suggestions but nothing that has worked so far, ultimately the framework extension is still throwing me an error (Must have ImagicK installed). I've tried things like: sudo apt-get update sudo apt-get install imagick-php5 .. etc as well as the PECL install which ends up throwing me the following error: Checking ImageMagick MagickWand API

how to change the DPI of an image from 72DPI to 300DPI with Imagick

≡放荡痞女 提交于 2019-11-27 08:11:33
问题 I have an image of 72DPI and i want to change this to 300DPI for printing purposes, I want all the stuff need to be done with imagick, tried with the code following but no positive results. <? $im = new Imagick(); $im->setResolution(72,72); $im->setOption('density','300x300'); $im->readImage("test.png"); header("Content-Type: image/png"); echo $im; ?> can someone help/clarify me the usage of setoption or can some one explain hot to change DPI in either iMagick or GD 回答1: I think this is what

Running ImageMagick on XAMPP 1.8.3 with Windows 7

大城市里の小女人 提交于 2019-11-27 08:03:32
I have been trying for hours to get ImageMagick working on my localhost (running XAMPP 1.8.3 on Windows 7). I have checked and tried literally every solution that I can find on this website, and dozens of others. Nothing works. No matter what combination of ImageMagick builds and imagick DLLs I try, I always get some kind of "can't find dll" error when I try to start Apache (the specific message varies based on what combination I'm trying, but it's always some sort of missing DLL message). Can anyone just give me a (moderately recent) combination of XAMPP/ImageMagick/Imagick that works? Chris

how to use imagick annotateImage for chinese text?

给你一囗甜甜゛ 提交于 2019-11-27 06:09:07
问题 I need to annotate an image with Chinese Text and I am using Imagick library right now. An example of a Chinese Text is 这是中文 The Chinese Font file used is this The file originally is named 华文黑体.ttf it can also be found in Mac OSX under /Library/Font I have renamed it to English STHeiTi.ttf make it easier to call the file in php code. In particular the Imagick::annotateImage function I also am using the answer from "How can I draw wrapped text using Imagick in PHP?". The reason why I am using

PHP Imagick PDF conversion Text aliasing

為{幸葍}努か 提交于 2019-11-27 04:54:23
问题 I'm having some troubles converting PDF files to JPEG with Imagick in PHP. After a lot of research, i'm able to convert CMYK pdf to RGB jpg without weird color conversion… but now, my last issue : the text is completely aliased ! The text from the original PDF file is not vectorized. An example : Here is the code : $imagick = new Imagick(); $imagick->setResolution(150,150); $imagick->readImage('file.pdf'); //CMYK PROFILE $icc = file_get_contents('USWebCoatedSWOP.icc'); $imagick->profileImage(

circularize an image with imagick

独自空忆成欢 提交于 2019-11-27 03:00:48
问题 Trying to take a rectangular photo, crop it into a square region, and then mask it into a circular with a transparent background. //$dims is an array with the width, height, x, y of the region in the rectangular image (whose path on disk is $tempfile) $circle = new \Imagick(); $circle->newImage($dims['w'], $dims['h'], 'none'); $circle->setimageformat('png'); $circle->setimagematte(true); $draw = new \ImagickDraw(); $draw->setfillcolor('#ffffff'); $draw->circle($dims['w']/2, $dims['h']/2,

Using Imagick in Symfony2?

假装没事ソ 提交于 2019-11-26 23:17:36
问题 I am trying to use Imagick with Symfony2, but every time I try and use it, it gives me the following error: Fatal error: Class 'Acme\TestBundle\Services\Imagick' not found... I am using Imagick in a service I have setup to manage my images. What do I need to do to be able to use this class? I can confirm the Imagick extension is working on the server and is in use by other sites. Thanks in advance for any help. 回答1: When you instantiate the Imagick class, use a full quallified class-name: new

PHP-Imagemagick image display

陌路散爱 提交于 2019-11-26 23:05:12
问题 I have php code which create pdf thumbnail as follows; <?php $file ="test.pdf"; $im = new imagick(realpath($file).'[0]'); $im->setImageFormat("png"); $im->resizeImage(200,200,1,0); header("Content-Type: image/jpeg"); $thumbnail = $im->getImageBlob(); echo $thumbnail; ?> Which is working well. But if I want to display the image in a web page, I have to use <img src=""> tag. Is there any way to remove header("Content-Type: image/jpeg"); from the syntax and echo image using <img src=""> ..? Or

How to remove exif from a JPG without losing image quality?

穿精又带淫゛_ 提交于 2019-11-26 23:03:01
问题 I have a PHP photo sharing application in which user-uploaded images are resized into various thumb formats using ImageMagick. As a seemingly "smart" way to save on file size, I am stripping exif info from these thumbs as follow: $imagick = new Imagick($image); $imagick->stripImage(); $imagick->writeImage($image); This works. It does remove the EXIF info, where a thumbs of 30KB saves 12KB and becomes 18KB. A significant saving when showing many of such thumbs on a single page. The problem