ai to jpg - transparent gradient issue

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
hawksz
Posts: 1
Joined: 2012-05-15T09:54:03-07:00
Authentication code: 13

ai to jpg - transparent gradient issue

Post by hawksz »

Hey everyone!

I'm very very new here and I hope that you can help me. I'm trying to convert an Illustrator .ai file to .jpg and everything is good but I have problems with transparent gradients in .ai file. If I have transparent gradient rectangle then the converter skips the alpha channel of it. For example: there's a 200x200px rect. The gradient is a 100% white at the top and it's 0% white at the bottom. If I convert the .ai to .jpg then this whole rectangle is white! If I set the opacity of a simply filled rectangle then it works properly.

Can I convert with transparent gradients?

The code I use:

Code: Select all

convert -verbose -monitor -colorspace sRGB -density 144 -scale '10000x10000>' a.ai -sampling-factor 2x1 -quality 100 -flatten a.jpg
Thank you!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ai to jpg - transparent gradient issue

Post by fmw42 »

jpg does not support transparency. Use gif or png or tiff. gif only supports binary transparency. If you need 8-bit transparency, use PNG32.

see
http://www.imagemagick.org/Usage/formats/#gif
http://www.imagemagick.org/Usage/formats/#png
Post Reply