Converting eps to eps3 loosing clipping path
Re: Converting eps to eps3 loosing clipping path
I think I am not explaining the current situation clear enough. Your file is saved but I don't think it is saved in level 3. A co-worker of mine has illustrator which has an option to force the output format as level 3. The file now starts with 'PS-Adobe-3.1 EPSF-3.0' but ImageMagick is unable to find a clipping path. Can you check illustrator again to see if you find an option to force level 3 and supply us with a new image that does contain a clipping path?
Re: Converting eps to eps3 loosing clipping path
No, it doesn't.alexm wrote:But it shows "ps:Level: Adobe-3.0 EPSF-3.0" - doesn't that mean level 3 ?
The string "Adobe-3.0 EPSF-3.0" has to be read as two different declarations:
- PS-Adobe-3.0
- EPSF-3.0
The second of these declarations, "EPSF-3.0", simply declares the file to be conforming to Adobe's version 3 of its specification document describing the Encapsulating PostScript Format (can be retrieved here: http://partners.adobe.com/public/develo ... F_Spec.pdf). This declaration also is not necessarily true... (same statement about real-world PS files as above could be repeated here).
Re: Converting eps to eps3 loosing clipping path
Any line in a PostScript file starting with the '%' character indicates that this complete line is a comment and should not be interpreted by the PostScript interpreter. (If the '%' character appears later on any line, then the rest of that line is to be treated as a comment.)dlemstra wrote: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?.
Hence, to insert '%BeginPhotoshop' as a line on its own anywhere in a PostScript 3 document is perfectly "legal".
While a PostScript interpreter should ignore this line, Photoshop itself is free to treat it any way it wants and (for example) use it as a "structuring" mark for its own purposes.
Re: Converting eps to eps3 loosing clipping path
We are saving it with Photoshop - there is no setting in the export dialog to specify postscript level. We choose the "Photoshop EPS" file format.dlemstra wrote:I think I am not explaining the current situation clear enough. Your file is saved but I don't think it is saved in level 3. A co-worker of mine has illustrator which has an option to force the output format as level 3. The file now starts with 'PS-Adobe-3.1 EPSF-3.0' but ImageMagick is unable to find a clipping path. Can you check illustrator again to see if you find an option to force level 3 and supply us with a new image that does contain a clipping path?
Re: Converting eps to eps3 loosing clipping path
alexm wrote:@pipitas
There IS a clipping path in JPG.
No, to my knowledge, clipping paths are no part in the official JPEG file format specification.
Yes, it is a proprietary extension of Photoshop. Only those applications which have reverse-engineered how it works can make use of it. Photoshop of course makes use of it automatically. (You luckily expressed it as "at least Photoshop can...")alexm wrote:At least photoshop can store it
Good then. -- Does it work reliably?!?alexm wrote:and it is displayed when I do a identify -verbose.
That's something different here. And it is "official"...alexm wrote:Also EPS files can have such a clipping path
Re: Converting eps to eps3 loosing clipping path
interesting.pipitas wrote:alexm wrote:@pipitas
There IS a clipping path in JPG.
No, to my knowledge, clipping paths are no part in the official JPEG file format specification.
.
okay. I love proprietary stuff ;-(pipitas wrote:Yes, it is a proprietary extension of Photoshop. Only those applications which have reverse-engineered how it works can make use of it. Photoshop of course makes use of it automatically. (You luckily expressed it as "at least Photoshop can...")alexm wrote:At least photoshop can store it
Yes that seems to work well.pipitas wrote:Good then. -- Does it work reliably?!?alexm wrote:and it is displayed when I do a identify -verbose.
Also preserving the path when converting works and when converting from EPS to JPG also. And this path can be read in photoshop ...
[/quote]pipitas wrote:That's something different here. And it is "official"...alexm wrote:Also EPS files can have such a clipping path
... only when we save to EPS3 the path is lost and can not be read in photoshop or imagemagick. In dlemstra's sample file after his modification the clipping path can not be read in photoshop but in imagemagick.
Re: Converting eps to eps3 loosing clipping path
The file contains a big chunk of binary "garbage", sized 64400 Bytes, before even the magic linealexm wrote:Did you find out how Photoshop is storing the clipping path different to ImageMagick? Can imagemagick store it the same way?
Code: Select all
%!PS-Adobe-3.0 EPSF-3.0
I assume the (proprietary!) clipping path of Photoshop (if at all contained in the file) is part of this 64400 bytes of binary. Because within the PostScript code itself there is no clipping path defined (and no `clip` operator used).
The only definition resembling a clipping path are these lines:
Code: Select all
%%BoundingBox: 0 0 240 240
%%HiResBoundingBox: 0 0 240 240
(For me, trying to guess it when rendering the file in Ghostview, I'd say it should be roughly within a BoundingBox of [42 61 121 142].)
Re: Converting eps to eps3 loosing clipping path
Hi,
the clipping path is supposed to be around the black triangle in the picture.
I have no idea as well how it is stored - but it can't be that proprietary or - if it is - it has been implemented in imagemagick, because identify can read it!
$ identify -verbose dreieck_rgb_pfad2_photoshop.eps
[...]
Clipping path:
<?xml version="1.0" encoding="iso-8859-1"?>
<svg width="240" height="240">
<g>
<path style="fill:#00000000;stroke:#00000000;stroke-width:0;stroke-antialiasing:false" d="
M 53,133
L 126,63
L 151,163
"/>
</g>
</svg>
So if IM can read it, it would be great if it was able to write it that way
Regards,
Alex
the clipping path is supposed to be around the black triangle in the picture.
I have no idea as well how it is stored - but it can't be that proprietary or - if it is - it has been implemented in imagemagick, because identify can read it!
$ identify -verbose dreieck_rgb_pfad2_photoshop.eps
[...]
Clipping path:
<?xml version="1.0" encoding="iso-8859-1"?>
<svg width="240" height="240">
<g>
<path style="fill:#00000000;stroke:#00000000;stroke-width:0;stroke-antialiasing:false" d="
M 53,133
L 126,63
L 151,163
"/>
</g>
</svg>
So if IM can read it, it would be great if it was able to write it that way
Regards,
Alex
Re: Converting eps to eps3 loosing clipping path
Hello again,
my knowledge of C++ is very bad ... but I had a look at coders/ps3.c (is that used also for eps3) ?
There is:
/*
PS clipping path from Photoshop clipping path.
*/
if ((image->read_mask != MagickFalse) ||
(LocaleNCompare("8BIM:",image->magick_filename,5) != 0))
(void) WriteBlobString(image,"/ClipImage {} def\n");
else
{
const char
*value;
value=GetImageProperty(image,image->magick_filename,exception);
if (value == (const char *) NULL)
return(MagickFalse);
(void) WriteBlobString(image,value);
(void) WriteBlobByte(image,'\n');
}
So it looks like there is some logic for storing the clipping path. But even when I convert to ps3 the clipping path is not recognized by identify.
(void) WriteBlobString(image,"/ClipImage {} def\n");
looks for my like an empty clipping path is written ?!
Is that a piece of non-implemented code?
my knowledge of C++ is very bad ... but I had a look at coders/ps3.c (is that used also for eps3) ?
There is:
/*
PS clipping path from Photoshop clipping path.
*/
if ((image->read_mask != MagickFalse) ||
(LocaleNCompare("8BIM:",image->magick_filename,5) != 0))
(void) WriteBlobString(image,"/ClipImage {} def\n");
else
{
const char
*value;
value=GetImageProperty(image,image->magick_filename,exception);
if (value == (const char *) NULL)
return(MagickFalse);
(void) WriteBlobString(image,value);
(void) WriteBlobByte(image,'\n');
}
So it looks like there is some logic for storing the clipping path. But even when I convert to ps3 the clipping path is not recognized by identify.
(void) WriteBlobString(image,"/ClipImage {} def\n");
looks for my like an empty clipping path is written ?!
Is that a piece of non-implemented code?
Re: Converting eps to eps3 loosing clipping path
Is there any update on this? Is this accepted as a bug?
Re: Converting eps to eps3 loosing clipping path
I am still trying to figure out what that part does. But I need some documentation on how the path should be stored in a ps3 file.
Re: Converting eps to eps3 loosing clipping path
No clue where to get that kind of documentation. But the key part is, that imagemagick CAN read that path - just not write. So that should be possible to debug?
Re: Converting eps to eps3 loosing clipping path
The file that you supplied looks like a version two document. The file I gave you earlier to test did the same in version 3 as we did in version 2 and it failed in Photoshop. Not sure how to proceed without some documentation.