convert eps with clipping path to transparant 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
vital

convert eps with clipping path to transparant png

Post by vital »

I am trying to convert a CMYK eps image with a clipping path to a transparant PNG file, but don't get a good PNG.
I've been reading some posts here and found some similar questions and tried the suggestions, but no results yet...

When i try the simple command:
convert input.eps output.png
the result is a png with a white background, no transparancy

When i add -colorspace RGB
convert -colorspace RGB input.eps output.png
the result is a transparant PNG file in RGB but the colours are really bad

When i try to convert the CMYK to RGB with the -profile option
convert input.eps -profile sRGB.icm output.png or
convert -profile sRGB.icm input.eps output.png
the colour is RGB and looking good but the transparancy has disappeared

Combining the -profile and -colorspace option doesn't give a better result

Also tried a lot of combinations with the -clip option, but never got any output file
Anyone suggestions?

IM version 6.6.0
eps is saved in Photoshop CS4
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: convert eps with clipping path to transparant png

Post by Drarakel »

First check if the clipping path is still in your file (for example in the messages of "identify -verbose output.png").
Then you have to use the right command to use the clipping path (it might depend on which svg renderer is used). Sometimes "-clip" might be enough, but you could also try something like that:
convert input.eps -profile sRGB.icm -alpha transparent -clip -alpha opaque output.png
vital wrote:When i add -colorspace RGB
convert -colorspace RGB input.eps output.png
the result is a transparant PNG file in RGB but the colours are really bad
When you use "-colorspace RGB" before the input file, IM might use the Ghostscript device "pngalpha". So, here, Ghostscript delivers the transparency. But this device is only fine for RGB files, not for CMYK input files.
vital

Re: convert eps with clipping path to transparant png

Post by vital »

Thanks for the reply, Drarakel.
Drarakel wrote:First check if the clipping path is still in your file (for example in the messages of "identify -verbose output.png").
Checked this again and there is a clipping path in the file available

I noticed now that every time i use the -clip command, the convert.exe application "encountered a problem and needed to close".

Anyone an idea what can cause this? Or where i can get more info about the cause of this.
I tried to read the information that the Windows server wants to send to Microsoft, but that is as clear to me as the shopping list of my chinese neighbour...

The Ghostscript part of your post explains a lot for me... I could not see the logic behind some of my testing results
Drarakel wrote:When you use "-colorspace RGB" before the input file, IM might use the Ghostscript device "pngalpha". So, here, Ghostscript delivers the transparency. But this device is only fine for RGB files, not for CMYK input files.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: convert eps with clipping path to transparant png

Post by Drarakel »

Can you post a link to your file?
I don't get any crashs when using "-clip" (IM v6.6.3-2 Q16, Windows XP, internal SVG renderer) - but maybe your file is different.
vital

Re: convert eps with clipping path to transparant png

Post by vital »

We're running ImageMagick 6.6.0 on a Windows server 2003 (standard edition)
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: convert eps with clipping path to transparant png

Post by Drarakel »

I'm getting a fine, transparent picture with:

Code: Select all

convert -density 300 70407_CrackingB.eps -profile sRGB.icm -alpha transparent -clip -alpha opaque test.png
What was the commandline that gave you a crash?
Maybe you have to update ImageMagick and/or Ghostscript.

You could also post the output of "convert -list configure" and "convert -list format" (here, only the lines with "SVG" are of interest).
vital

Re: convert eps with clipping path to transparant png

Post by vital »

The same command does not produce any output on our server.
Whenever I use the -clip command, ImageMagick crashes.

list configure:
CC vs8
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
HOST windows-unknown-linux-gnu
LIB_VERSION 0x660
LIB_VERSION_NUMBER 6,6,0,10
NAME ImageMagick
RELEASE_DATE 2010-04-01
VERSION 6.6.0
WEBSITE http://www.imagemagick.org

Ghostscript is version 8.71

list format:
...
SVG SVG rw+ Scalable Vector Graphics (XML 2.4.19)
SVGZ SVG rw+ Compressed Scalable Vector Graphics (XML 2.4.19)
...
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: convert eps with clipping path to transparant png

Post by Drarakel »

The messages look alright.

I tried it now with IM v6.6.0-10 - and yeah, in that version the internal SVG renderer has problems with your clipping path.

Conclusion: Update your ImageMagick to v6.6.3-2. The crash should be gone after that.
vital

Re: convert eps with clipping path to transparant png

Post by vital »

Thanks a lot for the great help, Drarakel!

I'm downloading the update right now...
vital

Re: convert eps with clipping path to transparant png

Post by vital »

Installed the update and it works fine now.

Thanks again Drarakel.
Post Reply