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.

Re: Transparency lost in PDF to PNG

Posted: 2019-06-09T08:34:24-07:00
by angelagates29
If you apply transparency to objects on a spread, all colors on that spread convert to the transparency blend space you’ve chosen (Edit > Transparency Blend Space), [https://www.pornjk.com/tags/spankbang/]Spankbang[/https://www.pornjk.com/tags/spankbang/] either Document RGB or Document CMYK, even if they’re not involved with transparency. Converting all the colors results in consistency across any two same-colored objects on a spread, and avoids more dramatic color behavior at the edges of transparency.
The above advice seems to imply only that it is bad to mix RGB and CMYK handling where transparency is concerned. (I would really love to understand what means that beautiful rhetoric of "edges of transparency".)
But the following text is more specific:
Depending on your workflow, do one of the following:
If you create documents for print only, choose Document CMYK for the blend space.
If you create documents for web only, choose Document RGB.
If you create documents for both print and web, decide which is more important, and then choose the blend space that matches the final output.
I would therefore advise to convert your images and blend space to CMYK. I do not know if that will help in your case, as the above article only gives hints which it does not explain.
Note that JPEG and PNG images are RGB. TIFF is better adapted to CMYK.