Composite multiple Vector EPS with Alpha Transparency to PNG

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
arber6

Composite multiple Vector EPS with Alpha Transparency to PNG

Post by arber6 »

I have 3 images in EPS CMYK format (created in Illustrator CS3): a background-image (Back.eps), a content-image (logo.eps), and a gloss-effect (gloss.eps). I'd like to stack/composite the images to create icon files in PNG format with transparency, for web use. The background and gloss-effect images will rarely change, but I will have many content-images.

Back.eps has rounded corners, so I'd like the corner-voids to be transparent.
logo.eps has a transparent background, so it should overlay back.eps.
gloss.eps has a transparent background, and a semi-transparent finish.

All three files are sized proportionally, so that they will stack appropriately.

I can use IM to achieve some of the desired outcomes, but not all of them. For example:
1. I can overlay logo-eps onto back.eps and maintain the transparency, if I use colorspace rgb, but the color conversion isn't great, and overlaying gloss.eps doesn't provide any alpha transparency for the gloss art.
2. I can get the color right on back.eps using profiles and then set colorspace to rgb, so the background and the logo look right, but I've lost the corner-void transaparency, and I still can't overlay the gloss without losing the alpha transparency.

Code: Select all

convert -density 300 -background none back.eps[150x150] -profile "H:\windows\system32\spool\drivers\color\USWebCoatedSWOP.icc" \
-profile "H:\Windows\system32\spool\drivers\color\colormatchrgb.icc" -trim -gravity center -colorspace rgb -background none \
logo.eps[100x100] -composite -background none -gravity south gloss.eps[150x] -composite icon.png
I've scoured the forum, and while I can find threads with CMYK/RGB color conversions and transparency, I can't find anything on composite + CMYK/RGB + Alpha.

Am I being too ambitious in trying to do this all in one command? If I need more than one command, what would be the ideal intermediary steps?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Composite multiple Vector EPS with Alpha Transparency to

Post by fmw42 »

Not sure all of what you are doing, but on a quick read...

You can try to doing one command line, but try using -respect-parenthesis and parentheses to separate the processing on your two images.

convert -respect-parenthesis \( image1 .... \) \( image2 ...\) -compose ... -composite result

That may help.

see
http://www.imagemagick.org/Usage/basics/#controls
http://www.imagemagick.org/Usage/basics/#parenthesis
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Composite multiple Vector EPS with Alpha Transparency to

Post by Drarakel »

And: Perhaps try to accomplish it step-by-step. First convert one single EPS and tweak the commands until you get the desired output from this input file. After you've done this with every input file, use the composite command with the intermediate outputs. Then try to combine all the commands.

Note that it can be very difficult to get correct colors AND transparency from CMYK EPS files. Ghostscript is involved - and Ghostscript doesn't have yet a full color management.. You may have to make some compromises. Of course, it depends on your EPS files (the colorspaces, and also how the transparency is stored).
If the problems persist, then you could post links to your input files, so that some users can take a look at them.
Post Reply