Page 1 of 1

Transparency lost in PDF to PNG

Posted: 2019-05-10T00:55:58-07:00
by Lincon
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

Re: Transparency lost in PDF to PNG

Posted: 2019-05-10T09:04:20-07:00
by fmw42
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.