Converting transparent PDF files with Imagick

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
friend
Posts: 1
Joined: 2012-10-04T02:17:33-07:00
Authentication code: 67789

Converting transparent PDF files with Imagick

Post by friend »

I have a problem creating thumbnails with PHP and imagick. The code is working ok and the thumbnail is generated in the correct size etc but when I try to place a PDF logo on the thumbnail it turns half transparent. I guess it has something to do with the PDF file being generated in InDesign and it probably doesn't have any background defined. Has anyone come across this problem or has an idea what to do about it? I tried to put a white canvas in the background but that didn't help. I also tried various channel settings for the compositeImage function but that didn't help either.

This is the PDF file I'm having issues with: https://dl.dropbox.com/u/13712643/Case_Study.pdf The generated Thumbnail looks like this: https://dl.dropbox.com/u/13712643/Case_Study1.jpg

The code I have produced so far: http://pastebin.com/74CYC972

Any ideas? Thank you for your help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting transparent PDF files with Imagick

Post by fmw42 »

Your PDF file is in CMYK colorspace and -composite, I believe needs to work in RGB. So do -colorspace sRGB before you read in your PDF, if your IM version is 6.7.6.7 or higher. If not, then use -colorspace RGB.

You don't show the image that you want to overlay. So that may help, if the above does not work.
Post Reply