Converting eps to eps3 loosing clipping path

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.
alexm
Posts: 17
Joined: 2015-03-19T10:15:14-07:00
Authentication code: 6789

Converting eps to eps3 loosing clipping path

Post by alexm »

I have an EPS file with a clipping path (as shown via identify -verbose).

When saving it to eps3 the clipping path is lost.

I use this command:

convert "cmyk_pfad_weiß.eps"[0] -clip -profile CMYK/USWebUncoated.icc -profile CMYK/USWebUncoated.icc eps3:cmyk_pfad_weiß.out.eps

When saving to normal EPS the clipping path is there, but the color profile becomes sRGB and all colors look inverted.

Version:

Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting eps to eps3 loosing clipping path

Post by snibgo »

Your version is very old. I suggest you try it with a more recent version. If that doesn't help, upload a test image to somewhere like dropbox.com and paste the URL here.
snibgo's IM pages: im.snibgo.com
alexm
Posts: 17
Joined: 2015-03-19T10:15:14-07:00
Authentication code: 6789

Re: Converting eps to eps3 loosing clipping path

Post by alexm »

Hi,

I just tried it with IM 6.9.0-10 Q16 x64_64 - same problem.
Currently I can not provide the EPS, but with a JPEG (with Path) -> EPS3 I have the same problem.

Here is the file I am using: http://www.file-upload.net/download-104 ... d.jpg.html


$ /opt/imagemagick-6.9/bin/identify -verbose dreieck_rgb_pfad.jpg | grep Clipping
Clipping path:
$ /opt/imagemagick-6.9/bin/convert dreieck_rgb_pfad.jpg -clip eps3:out.eps
$ /opt/imagemagick-6.9/bin/identify -verbose out.eps | grep Clipping
(no output)


Regards,

Alex
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting eps to eps3 loosing clipping path

Post by snibgo »

Okay, converting to EPS: retains the clip path but converting to EPS3: doesn't. Sorry, I know nothing about EPS files. Someone else might comment.
snibgo's IM pages: im.snibgo.com
alexm
Posts: 17
Joined: 2015-03-19T10:15:14-07:00
Authentication code: 6789

Re: Converting eps to eps3 loosing clipping path

Post by alexm »

Can this be fixed?
alexm
Posts: 17
Joined: 2015-03-19T10:15:14-07:00
Authentication code: 6789

Re: Converting eps to eps3 loosing clipping path

Post by alexm »

Is anybody available to fix his on hire-basis. What would be the cost? You could send me an email to a.menk at imi.de
pipitas
Posts: 168
Joined: 2012-07-15T14:06:46-07:00
Authentication code: 15

Re: Converting eps to eps3 loosing clipping path

Post by pipitas »

alexm wrote: Currently I can not provide the EPS, but with a JPEG (with Path) -> EPS3 I have the same problem.

Here is the file I am using: http://www.file-upload.net/download-104 ... d.jpg.html


$ /opt/imagemagick-6.9/bin/identify -verbose dreieck_rgb_pfad.jpg | grep Clipping
Clipping path:
I really don't understand what you are trying to achieve.

There is no such thing (as far as I am aware of) as a "clipping path" in a JPEG...

Can you explain in laymen's word what it is that you finally try to achieve when processing your EPS files in question?

Because ImageMagick isn't the best thing in the world to process EPS. ImageMagick excels when it comes to raster formats.

EPS can be three things:
  1. entirely composed of vector shapes (possibly including text made with fonts)
  2. entirely composed of raster images
  3. composed of a mix of rasters and vectors
In each and every case ImageMagick does not process the EPS input itself. It calls Ghostscript as its delegate, and asks it to convert the EPS page into a complete raster image first. Only then does IM kick in and start to do what it can best: process the raster image it received from Ghostscript. When IM then creates an output EPS, that will always be a raster image, wrapped into an EPS syntax framework...

If your final goal is to again get an EPS output from the EPS input, you'll never get the vectors back. That means you have very likely lost contents and quality. You certainly will have lost any fonts that may have been contained in the original EPS.

There may be other ways to convert an EPS to EPS than going through the ImageMagick detour which enforces rasterization of whatever vectors where in the input...
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Converting eps to eps3 loosing clipping path

Post by dlemstra »

I just tried to see if I could copy the part that writes the 8bim profile which contains the clippath to the eps3 writer and IM can read the profile. (the output file can be found here: https://www.dropbox.com/s/3i3b7ju7l2fxp ... d.eps?dl=0) But I cannot find a document that tells me if this is allowed according to the official PostScript specifications. Can you or one of the other readers of this topic help me find a document that tells us it is allowed to write '%BeginPhotoshop' in a PostScript 3 document?

p.s. I got the feeling this is evil since this is my 666th post.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
alexm
Posts: 17
Joined: 2015-03-19T10:15:14-07:00
Authentication code: 6789

Re: Converting eps to eps3 loosing clipping path

Post by alexm »

@pipitas

There IS a clipping path in JPG. At least photoshop can store it and it is displayed when I do a identify -verbose. Also EPS files can have such a clipping path.
Anyways, I am aware of the fact that other vectors are lost when converting with imagemagick. In our case the images are raster images embedded in EPS with a clipping path - so this should not be a problem.

@dlemstra:

Thanks for the test. I can see the clipping path in IM - but not in Photoshop.
I have no clue which format photoshop is expecting.

I have a file here created by photoshop with a clipping path:

https://cloud.imi.de/public.php?service ... fd04c2556a (dreieck_rgb_pfad2_photoshop.eps)

Image magick also reads this clipping path.

What I saw is that the file you uploaded causes photoshop to display a rastering dialog when opened, the files I have to convert and the dreieck_rgb_pfad2_photoshop.eps do not cause this raster dialog and a clipping path is available in Photoshop.

Regards,

Alex
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Converting eps to eps3 loosing clipping path

Post by dlemstra »

This looks like a Level 1 Postscript file. I don't have Photoshop but is there an option to save the eps file in a Postscript 3 format?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
alexm
Posts: 17
Joined: 2015-03-19T10:15:14-07:00
Authentication code: 6789

Re: Converting eps to eps3 loosing clipping path

Post by alexm »

But it shows "ps:Level: Adobe-3.0 EPSF-3.0" - doesn't that mean level 3 ?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Converting eps to eps3 loosing clipping path

Post by dlemstra »

I really don't know if the format is 'level' 3. But ImageMagick writes the image data differently from the file you supplied. The eps file that I supplied contains a 'DisplayImage' block and your file contains 'beginimage'. It looks like in our eps3 writer the image is written 'as is' instead of a block of 'pixels' (FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF). This is what makes 'my' file much smaller.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
alexm
Posts: 17
Joined: 2015-03-19T10:15:14-07:00
Authentication code: 6789

Re: Converting eps to eps3 loosing clipping path

Post by alexm »

okay. did you find anything about the clipping path? Where it is different? How can I view the Postscript source of an EPS file? It looks compressed.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Converting eps to eps3 loosing clipping path

Post by dlemstra »

I am just viewing the eps files with a text editor. The file that you supplied seems to create the image in a different format then ImageMagick.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
alexm
Posts: 17
Joined: 2015-03-19T10:15:14-07:00
Authentication code: 6789

Re: Converting eps to eps3 loosing clipping path

Post by alexm »

Did you find out how Photoshop is storing the clipping path different to ImageMagick? Can imagemagick store it the same way?
Post Reply