| Author |
Extract clipping path from EPS
|
|
| Andre Dierker 2005-11-21, 7:57 am |
| Hi all!
I want to extract the clipping path from an Photoshop-EPS. I'm not
interested in the curve itself but in the clipped region. A
bitmap-extraction would be sufficient. So I tried
convert -clip -fill
to fill the clipped region with a special color. Unfortunately either
convert or gs couldn't detect the clipping path in the eps.
This is what I did:
$ convert -version
Version: ImageMagick 6.2.4 10/06/05 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC
$gs --version
8.01
$ convert -verbose -clip -fill white G555005f.eps G555005f_conv.eps
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
+"-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g190x680"
+"-r72x72" "-sOutputFile=/tmp/magick-XXAwvMm6" "-f/tmp/magick-XXzAr3XB"
+"-f/tmp/magick-XXeap4L7"Start of Image
Define Huffman Table 0x00
0 1 5 1 1 1 1 1
1 0 0 0 0 0 0 0
Define Huffman Table 0x01
0 3 1 1 1 1 1 1
1 1 1 0 0 0 0 0
Define Huffman Table 0x10
0 2 1 3 3 2 4 3
5 5 4 4 0 0 1 125
Define Huffman Table 0x11
0 2 1 2 4 4 3 4
7 5 4 4 0 1 2 119
End Of Image
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
+"-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g190x680"
+"-r72x72" "-sOutputFile=/tmp/magick-XXAwvMm6" "-f/tmp/magick-XXzAr3XB"
+"-f/tmp/magick-XXeap4L7" -c showpage/tmp/magick-XXAwvMm6[0] BMP 190x680
+PseudoClass 256c 514kb
/tmp/magick-XXAwvMm6[1] BMP 190x680 PseudoClass 256c 514kb
/tmp/magick-XXAwvMm6[2] BMP 190x680 PseudoClass 256c 514kb
/tmp/magick-XXAwvMm6[3] BMP 190x680 PseudoClass 256c 514kb
/tmp/magick-XXeap4L7 PS 190x680 190x680+0+0 DirectClass 514kb
G555005f.eps EPT 190x680 190x680+0+0 DirectClass 514kb
G555005f.eps EPT 190x680 190x680+0+0 DirectClass 514kb
G555005f.eps=>G555005f_conv.eps EPT 190x680 190x680+0+0
DirectClass 773kb 0.300u
+0:02
convert: no clip path defined `G555005f.eps': No such file or directory.
$
I"m sure the is a clipping path in the EPS. If you like to see it
yourself i've uploaded it (annd the resulting file G555005f_conv.eps) to
http://www.kand.de/magick/
Do you have any hints?
Do you know whom to blame?
convert? gs? Me?
Thanks, Andre
| |
| Andre Dierker 2005-11-22, 7:01 pm |
| On 2005-11-21 13:19:09 +0100, Andre Dierker <dierker@kand.de> said:
> Hi all!
>
> I want to extract the clipping path from an Photoshop-EPS. I'm not
> interested in the curve itself but in the clipped region. A
> bitmap-extraction would be sufficient. So I tried
> convert -clip -fill
> to fill the clipped region with a special color. Unfortunately either
> convert or gs couldn't detect the clipping path in the eps.
[..]
> Do you have any hints?
> Do you know whom to blame?
> convert? gs? Me?
Since there are still no answers I managed to have a small budget for this.
Is someone interested?
Thanks, Andre
| |
| Helge Blischke 2005-11-22, 7:01 pm |
| Andre Dierker wrote:
>
> On 2005-11-21 13:19:09 +0100, Andre Dierker <dierker@kand.de> said:
>
> [..]
>
> Since there are still no answers I managed to have a small budget for this.
>
> Is someone interested?
>
> Thanks, Andre
As Photoshop provides, AFAIK, several mothods to define a clipping path, pleas post
(an URL to) a sample file.
Helge
--
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de
| |
| Andre Dierker 2005-11-23, 7:57 am |
| On 2005-11-22 16:30:32 +0100, Helge Blischke <h.blischke@srz.de> said:
> Andre Dierker wrote:
>
> As Photoshop provides, AFAIK, several mothods to define a clipping
> path, pleas post
> (an URL to) a sample file.
I've uploaded one EPS file and the result after converting with imagemagick to
http://www.kand.de/magick/
Andre
| |
| hoffmann@fho-emden.de 2005-11-23, 7:00 pm |
| Andre,
PhS7 EPS with clipping path uses eofill.
Did you find this this operator by using e.g. WordPad ?
Your examples don't show clean clipping paths, IMO.
Best regards --Gernot Hoffmann
| |
| Helge Blischke 2005-11-25, 7:57 am |
| Andre Dierker wrote:
>
> On 2005-11-22 16:30:32 +0100, Helge Blischke <h.blischke@srz.de> said:
>
>
> I've uploaded one EPS file and the result after converting with imagemagick to
> http://www.kand.de/magick/
>
> Andre
Looking at the image using Photoshow reveals that the path is indeed properly defined but
not specified as a clipping path. Thus the PostScript part of the "Photoshop EPS" (which contains
the embedded Photoshop source document as well) only defines a rectangular clipping area which covers
just the rectangular image plane.
Modify the image in Photoshop (define the path as clipping path), save again as EPS, and rerun convert.
Helge
--
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de
| |
| hoffmann@fho-emden.de 2005-11-25, 7:00 pm |
| Yes,
my mistake as well. Saving a selection (as defined by the path)
by the Export Wizzard delivers eofill in the source code,
but saving the path as clipping path delivers eoclip.
Depending on the application the image may look just the same.
Best regards --Gernot Hoffmann
| |
| Andre Dierker 2005-11-28, 7:57 am |
| Helge Blischke wrote:
> Andre Dierker wrote:
>
> Looking at the image using Photoshow reveals that the path is indeed
> properly defined but not specified as a clipping path. Thus the PostScript
> part of the "Photoshop EPS" (which contains the embedded Photoshop source
> document as well) only defines a rectangular clipping area which covers
> just the rectangular image plane.
Yes, you are right!
> Modify the image in Photoshop (define the path as clipping path), save
> again as EPS, and rerun convert.
I had a few problems doing that (I'm Photoshop newbie) but succeeded in the
end. Additionally I had to remove the binary garbage before '%!' because
convert didn't like it:
$ convert -clip -fill white G555005f_clip.eps G555005f_clip_conv.eps
convert: no decode delegate for this image format `G555005f_clip.eps'.
Unfortunately convert still does not recognize the path:
$ convert -verbose -clip -fill white G555005f_clip_strip.eps
G555005f_clip_strip_conv.eps
/tmp/magick-XXChbTp8[0] BMP 190x680 PseudoClass 256c 514kb
/tmp/magick-XXChbTp8[1] BMP 190x680 PseudoClass 256c 514kb
/tmp/magick-XXChbTp8[2] BMP 190x680 PseudoClass 256c 514kb
/tmp/magick-XXChbTp8[3] BMP 190x680 PseudoClass 256c 514kb
G555005f_clip_strip.eps PS 793x2835=>190x680 190x680+0+0 DirectClass 514kb
convert: no clip path defined `G555005f_clip_strip.eps': No such file or
directory.
"gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
"-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g190x680"
"-r72x72" "-sOutputFile=/tmp/magick-XXChbTp8" "-f/tmp/magick-XXfclgd9"
"-fG555005f_clip_strip.eps""gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000
-dNOPAUSE -dAlignToPixels=0 -sDEVICE="epswrite"
-sOutputFile="G555005f_clip_strip_conv.eps" -f"G555005f_clip_strip.eps"
I've uploaded the files to the URL above.
Any hint?
Thank you very much!
Andre
| |
| Helge Blischke 2005-11-28, 7:57 am |
| Andre Dierker wrote:
>
> Helge Blischke wrote:
>
>
> Yes, you are right!
>
>
> I had a few problems doing that (I'm Photoshop newbie) but succeeded in the
> end. Additionally I had to remove the binary garbage before '%!' because
> convert didn't like it:
> $ convert -clip -fill white G555005f_clip.eps G555005f_clip_conv.eps
> convert: no decode delegate for this image format `G555005f_clip.eps'.
>
> Unfortunately convert still does not recognize the path:
> $ convert -verbose -clip -fill white G555005f_clip_strip.eps
> G555005f_clip_strip_conv.eps
> /tmp/magick-XXChbTp8[0] BMP 190x680 PseudoClass 256c 514kb
> /tmp/magick-XXChbTp8[1] BMP 190x680 PseudoClass 256c 514kb
> /tmp/magick-XXChbTp8[2] BMP 190x680 PseudoClass 256c 514kb
> /tmp/magick-XXChbTp8[3] BMP 190x680 PseudoClass 256c 514kb
> G555005f_clip_strip.eps PS 793x2835=>190x680 190x680+0+0 DirectClass 514kb
> convert: no clip path defined `G555005f_clip_strip.eps': No such file or
> directory.
> "gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
> "-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g190x680"
> "-r72x72" "-sOutputFile=/tmp/magick-XXChbTp8" "-f/tmp/magick-XXfclgd9"
> "-fG555005f_clip_strip.eps""gs" -q -dBATCH -dSAFER -dMaxBitmap=500000000
> -dNOPAUSE -dAlignToPixels=0 -sDEVICE="epswrite"
> -sOutputFile="G555005f_clip_strip_conv.eps" -f"G555005f_clip_strip.eps"
>
> I've uploaded the files to the URL above.
>
> Any hint?
>
> Thank you very much!
> Andre
I'm not quite sure what you are intending to get out of convert. The EPS that comes out of
convert no longer contains the clipping path, but the image itself has properly been clipped.
If you want to achieve something like a mask image for the clipping region, I guess you would
have to write some PostScript program to do that.
Helge
--
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de
| |
| bobbingaround 2006-01-10, 12:09 am |
| Actually the easiest way to get your clipping paths done are just by outsourcing. I realized this when some acquiantences told me about a website that does your clipping paths and sends it back to within a day at a reasonable price. I think the website is www.LazyMask.com.
Check it out maybe it will help.
Cheers |
|
|
|