convert PS to PNG with color profiles sometimes fails

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
kriks
Posts: 114
Joined: 2008-01-04T05:52:03-07:00

convert PS to PNG with color profiles sometimes fails

Post by kriks »

Hi,

we've ran into a strange problem.
We convert CMYK EPS into RGB PNG with color profiles using this command line :

Code: Select all

convert -density 300 in.eps -profile Photoshop5DefaultCMYK.icc -profile AdobeRGB1998.icc +clip-path '#1' -fuzz 100% -transparent white -fuzz 0% -strip -format PNG24 -compress LZW -quality 95 -type Optimize -depth 8 -trim -resize 237x195 out.png
which works well for most of our cases.

But it seems that with some kind of EPS (PS?), convert will look for a wmf2eps binary, as if it was SVG or WMF.
Identify on this suspect file :

Code: Select all

115746.eps PS 3416x2813=>3417x2813 3417x2813+0+0 16-bit ColorSeparation DirectClass 36.67mb
here is the file : http://www.pingroom.net/115746.eps

it looks like a PS file, is there something different to make in the command line? Or is this file the problem?

Thanks for your help
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert PS to PNG with color profiles sometimes fails

Post by magick »

We're using ImageMagck 6.5.6-4 and it correctly identifies your image as an EPS image:
  • identify 115746.eps
    115746.eps PS 3416x2813=>3417x2813 3417x2813+0+0 16-bit ColorSeparation DirectClass 36.67MiB 0.400u 0:00.110
We're not sure why its failing for you.
kriks
Posts: 114
Joined: 2008-01-04T05:52:03-07:00

Re: convert PS to PNG with color profiles sometimes fails

Post by kriks »

We use :

Code: Select all

#convert -version
Version: ImageMagick 6.5.6-1 2009-09-16 Q16 OpenMP http://www.imagemagick.org
#gs -version
GPL Ghostscript 8.64 (2009-02-03)
in your identify command, I see PS in the result, not EPS, nor EPT

could you try with the profiles please?

EDIT : I forgot to say that the convert works without the profile options :?
kriks
Posts: 114
Joined: 2008-01-04T05:52:03-07:00

Re: convert PS to PNG with color profiles sometimes fails

Post by kriks »

up.

could you please have a deeper look?

some more informations :

adding a -strip just after the input filename makes the wmf2eps message to go away, but instead we have those messages:

Code: Select all

convert: associate profile with image, a source and destination color profile required for transform `icc' @ profile.c/ProfileImage/902.
convert: no clip path defined `115746.eps': No such file or directory @ image.c/ClipImagePath/986.
which makes me think that a bug happens (wrong format detection?) because of the extra informations deleted by -strip.

one more information :

making just :

Code: Select all

convert 115746.eps out.eps
gets me a RGB eps and the source is CMYK eps. Is it normal?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert PS to PNG with color profiles sometimes fails

Post by magick »

Color conversion requires two profiles. If your image already has a profile only one -profile option on your command line is required. The -strip option strips any profiles from your image so in that case you need two -profile options, one source and one destination color profiles. The wmf2eps problem is because ImageMagick is trying to render the clipping mask and you do not have the required delegate support. Type
  • identify -list format
You need a mode of rw+ for SVG in order to render an SVG clipping mask.
kriks
Posts: 114
Joined: 2008-01-04T05:52:03-07:00

Re: convert PS to PNG with color profiles sometimes fails

Post by kriks »

ok, thanks for the hint.

after installing a bunch of dependencies for librsvg2 on the server and recompiling imagemagick, the rw+ is finally here, thanks.

for the most that we tested now it seems ok, but this PNG output is strange : http://www.pingroom.net/115746.png
the clip-path seems to not be applied correctly. could this be related to ghostscript? should we update (currently 8.64)?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert PS to PNG with color profiles sometimes fails

Post by magick »

Take a look at the clip path with identify -verbose 115746.png. Notice the image is 226x195 but the clipping path is 3417x2813.
kriks
Posts: 114
Joined: 2008-01-04T05:52:03-07:00

Re: convert PS to PNG with color profiles sometimes fails

Post by kriks »

yes, in the PNG, but in the original EPS, the image has the same dimensions as the clipping path:

Code: Select all

Format: PS (PostScript)
  Class: DirectClass
  Geometry: 3417x2813+0+0
  Base geometry: 3416x2813
  Resolution: 300x300
  Print size: 11.39x9.37667
  Units: PixelsPerInch
maybe it's just this image which is corrupt somewhere, but I wouldn't like to have this problem "sometimes", by surprise.
Post Reply