AI to PNG Transparency
AI to PNG Transparency
I had a problem with getting EPS files to convert to PNG files (see here) while maintaining their transparency. I'd just like to say that AI (Adobe Illustrator CS2) files also fail to maintain their transparency when converted to PNG. I've tried the '-colorspace rgb' addition that was mentioned to temporarily fix the EPS bug but unfortunately it didn't seem to work. It's not a major problem as I don't actually need to convert the AI files, but I thought it was worth mentioning in case someone does!
Re: AI to PNG Transparency
Post a URL to one or two AI images so we can download and reproduce the problem. Thanks.
Re: AI to PNG Transparency
Sorry I meant to post links to example files and forgot.
Here they are
Adobe Illustrator CS
Adobe Illustrator CS2
Adobe Illustrator CS3
Here they are
Adobe Illustrator CS
Adobe Illustrator CS2
Adobe Illustrator CS3
Re: AI to PNG Transparency
ImageMagick utilizes the Ghostscript delegate to render Postscript and PDF. The Ghostscript pngalpha device supports transparency but for only one page. Since there is no easy way to determine if a PDF is only one page we use the pnmraw device instead which does not support transparency. Until Ghostscript provides a multi-page device that supports transparency the only solution is to edit delegates.xml and change the ps:color delegate from pnmraw to pngalpha or use the Ghostscript application directly.
Re: AI to PNG Transparency
Thank you for the relpy. Changing the XML does fix the problem Interestingly I have had a look and Adobe Illustrator doesn't actually support multi-page, so if you did want to convert ai files the change wouldn't have a negative impact. Or at least it wouldn't as long as you didn't want to convert a multi-page document (would that be from a PDF? I can't think of anything else that is multi-page.). I presusme that if you used this all the time then a multi-page document would have it's first page made transparent and then the rest white?
Re: AI to PNG Transparency
We have a patch in ImageMagick 6.3.7-9 Beta (available sometime tomorrow) that will display AI images as transparent but only if its explicitly specified as follows:
- display ai:test3.ai
Re: AI to PNG Transparency
Excellent
Will it be just the display for now or will it work with convert as well? I take it the program can't be made to recognise the AI images automatically? Do you happen to know if this new patch will also fix the transparency problem with EPS files saved in Imageformat version 2 (as mentioned in this thread)
Will it be just the display for now or will it work with convert as well? I take it the program can't be made to recognise the AI images automatically? Do you happen to know if this new patch will also fix the transparency problem with EPS files saved in Imageformat version 2 (as mentioned in this thread)
Re: AI to PNG Transparency
The problem is EPS is the language level. When we checked the specification, transparency was not supported until Level 3. Its possible the language level was not properly reported for the thread you mentioned or we got it wrong. Either way, transparent EPS should render properly with the latest ImageMagick release (assuming your version of Ghostscript supports the pngalpha device).
Re: AI to PNG Transparency
Thanks for the info. I have also looked up the specification and like you said only Level 3 supports transparency. Apparently Adobe Illustrator and other programs 'fake' the background transparency in the EPS files, which is why it 'appears' that a Level 2 EPS has a transparent background. I was wondering if there was a 'command' that I could use that would make the white background transparent (as white is not used in any of my images since the printer doesn't understand 'white' ink :lol). I tried to use -transparent white, but it doesn't work unless I save the EPS to the PNG and then re-run the command on the PNG.
Re: AI to PNG Transparency
This works for us (using ImageMagick 6.3.7-8):
- convert logo: logo.eps
convert -colorspace rgb logo.eps -transparent white logo.png
Re: AI to PNG Transparency
Well I don't believe it! I tried that and it wouldn't work, but now it does! I think it's time for a bit of clean up as I'm probably getting versions confused again. Sorry to have been a pain
All the best and keep up the good work
All the best and keep up the good work
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: AI to PNG Transparency
Be careful, that just replaces any pure white pixels with transparency. It will probably have the side effect of leaving white halos around text and lines.magick wrote:This works for us (using ImageMagick 6.3.7-8):
- convert logo: logo.eps
convert -colorspace rgb logo.eps -transparent white logo.png
For alternatives see IM Examples, Text Handling, Postscript.
http://imagemagick.org/Usage/text/#postscript
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: AI to PNG Transparency
Thanks for the 'halo' info Anthony It shouldn't be a problem in my particular case as I'm taking images that are a minimum of 1000px (wide), doing the required conversions and then reducing them to around 100px (wide) max for preview purposes.anthony wrote:Be careful, that just replaces any pure white pixels with transparency. It will probably have the side effect of leaving white halos around text and lines.magick wrote:This works for us (using ImageMagick 6.3.7-8):
- convert logo: logo.eps
convert -colorspace rgb logo.eps -transparent white logo.png
For alternatives see IM Examples, Text Handling, Postscript.
http://imagemagick.org/Usage/text/#postscript