Transparency lost in PDF to PNG

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
Lincon
Posts: 1
Joined: 2019-05-10T00:52:09-07:00
Authentication code: 1152

Transparency lost in PDF to PNG

Post by Lincon » 2019-05-10T00:55:58-07:00

Hello everyone,,
I'm reading a PDF file (adobe illustrator) and trying to save it as png

Code: Select all

$img->read('logo.ai');
$img->write('logo.png');

The probleme is that I'm loosing all the transparency and semi-transparency

using instead:
$img->read('logo.ai');
$img->Transparent('color' => 'white');
$img->write('logo.png');
doesn't resolve the problem for the semi-transparency.

What are the correct PerlMagick (ver: 6.5.1.1) settings to use?

Sincerly

User avatar
fmw42
Posts: 25656
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Transparency lost in PDF to PNG

Post by fmw42 » 2019-05-10T09:04:20-07:00

Best to post a link to your AI file so we can test with it. But if it is CMYK, then you will need to read it in as RGB using the PerlMagick equivalent of

Code: Select all

convert -colorspace sRGB logo.ai ....
Imagemagick uses Ghostscript to read PDF, PS, AI etc. But Ghostscript cannot handle CMYK with alpha.

Post Reply