ai to png transparency
ai to png transparency
Hi,
I need to convert image files to png. It works in general, but I lost transparency with the illustrator files.
I'm not sure if I should post this here or in a ghostscript forum ?
The command I use is:
~/opt/imagemagick/bin/convert test.ai -background transparent -alpha on test.png
This is imagemagick 6.6.5-8
The gs executed command is:
"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=/tmp/magick-XXBlesqU" "-f/tmp/magick-XXdloVsM" "-f/tmp/magick-XXg7UvvE"
You can check the test file here:
http://benoit.boceto.fr/test/test.ai
Which arguments should I use ?
Thanks
I need to convert image files to png. It works in general, but I lost transparency with the illustrator files.
I'm not sure if I should post this here or in a ghostscript forum ?
The command I use is:
~/opt/imagemagick/bin/convert test.ai -background transparent -alpha on test.png
This is imagemagick 6.6.5-8
The gs executed command is:
"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=/tmp/magick-XXBlesqU" "-f/tmp/magick-XXdloVsM" "-f/tmp/magick-XXg7UvvE"
You can check the test file here:
http://benoit.boceto.fr/test/test.ai
Which arguments should I use ?
Thanks
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: ai to png transparency
It may be the ghostscript device set up in IM (which you can change in one of the xml files, but I don't recall which one).
But you can try
~/opt/imagemagick/bin/convert test.ai -channel rgba -alpha on test.png
Note -background -transparent is a setting and does nothing in your case.
But you can try
~/opt/imagemagick/bin/convert test.ai -channel rgba -alpha on test.png
Note -background -transparent is a setting and does nothing in your case.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: ai to png transparency
In this case Set the -channel BEFORE reading the 'ai' image as in this case it is used to switch the postscript generator (ghostscript) to a mode that generate transparency.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: ai to png transparency
Which channel ?anthony wrote:In this case Set the -channel BEFORE reading the 'ai' image as in this case it is used to switch the postscript generator (ghostscript) to a mode that generate transparency.
I try with rgba, and it doesn't change the results:
convert -channel rgba test.ai -background transparent -alpha on test.png
The original image should be completly transparent. Using the convert command, I've got a transparent image, but "bound" of the image has a white background.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: ai to png transparency
For other techniques see...
http://www.imagemagick.org/Usage/test/#postscript
Opps it appears those examples has broken!!! Arrggghhh... Working to fix them.
http://www.imagemagick.org/Usage/test/#postscript
Opps it appears those examples has broken!!! Arrggghhh... Working to fix them.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: ai to png transparency
Try this:
- convert ai:test.ai test.png
Re: ai to png transparency
I have the same results (I've also tried with the version 6.6.6-5). Where can I check the 6.6.6-6 beta version ?magick wrote:Try this:
In the mean-time we'll add a patch to ImageMagick 6.6.6-6 Beta so that you can simply specify test.ai rather than ai:test.ai.
- convert ai:test.ai test.png
Does it help you if I publish the png exported by photoshop ? (and the one generated by imagemagick) ?
Re: ai to png transparency
Yes try ImageMagick 6.6.6-6 Beta @ ftp://ftp.imagemagick.org/pub/ImageMagick/beta. It has a patch for PNG transparency.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: ai to png transparency
-background transparent as I said before will not do anything for you in this case as it is a setting and not an operation.
I think Anthony is suggesting:
convert -channel rgba -alpha on image.ai image.png
But apparently there is still a bug in PNG transparency that Magick indicates may be fixed in IM 6.6.6.6 beta. Betas are available at ftp://ftp.imagemagick.org/pub/ImageMagick (see the beta folder)
I think Anthony is suggesting:
convert -channel rgba -alpha on image.ai image.png
But apparently there is still a bug in PNG transparency that Magick indicates may be fixed in IM 6.6.6.6 beta. Betas are available at ftp://ftp.imagemagick.org/pub/ImageMagick (see the beta folder)
Re: ai to png transparency
It doesn't work with the 6.6.6-6 2010-12-17
I have the same result:
http://benoit.boceto.fr/test/test.html
The result I should have (made using photoshop):
http://benoit.boceto.fr/test/test-ps.html
This command give me a white background:
convert -channel rgba -alpha on test.ai test.png
I have the same result:
http://benoit.boceto.fr/test/test.html
The result I should have (made using photoshop):
http://benoit.boceto.fr/test/test-ps.html
This command give me a white background:
convert -channel rgba -alpha on test.ai test.png
Re: ai to png transparency
The problem is with Ghostscript, not ImageMagick. ImageMagick uses Ghostscript as a delegate for interpreting Postscript and PDF. If you bypass ImageMagick and use Ghostscript directly from the command line it produces the same result as http://benoit.boceto.fr/test/test.html. Post a bug report to the Ghostscript bug forum if you want a fix to the problem you reported.