Can I convert EPS to JPG Ignoring clipping path?

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
fcaserio
Posts: 26
Joined: 2007-03-19T15:22:12-07:00

Can I convert EPS to JPG Ignoring clipping path?

Post by fcaserio »

When I convert an EPS file with a clipping path to JPG the pixels outside the clipping patch are discarded.
Is there any way to make the conversion keeping the info outside the clipping path?
obs: it is good that the clipping path remains on the converted image, but I have to mantain all the original pixels of the image.
fcaserio
Posts: 26
Joined: 2007-03-19T15:22:12-07:00

Re: Can I convert EPS to JPG Ignoring clipping path?

Post by fcaserio »

Can anybody help me? I've been trying lots os options, but the conversion allways discards the pixels outside the path.
My original files are EPS created by Photoshop 7 with an unique path.
The converted JPG created has a white area outside the path, and I want to keep the original background of the image.

Any help or comment is wellcome
pjvedder
Posts: 12
Joined: 2011-06-22T12:39:02-07:00
Authentication code: 8675308

Re: Can I convert EPS to JPG Ignoring clipping path?

Post by pjvedder »

I'm having the exact same problem here, and I could use an answer to this problem myself. Here is the command line I'm using to convert an eps to a jpg:

convert GoldRings2.eps GoldRings2.jpg

Here is the image I'm using:
http://dl.dropbox.com/u/14916695/GoldRings2.eps

and the resulting bad jpg:
http://dl.dropbox.com/u/14916695/GoldRings2.jpg

I'm using ImageMagick 6.7.0-8 Q16 and GhostScript 9.02

Any help would be greatly appreciated... thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Can I convert EPS to JPG Ignoring clipping path?

Post by fmw42 »

try adding +clip-path or +profile * or -strip and see if any of those help (though I believe in newer IM, -strip does not remove the profiles, but I am not sure).
pjvedder
Posts: 12
Joined: 2011-06-22T12:39:02-07:00
Authentication code: 8675308

Re: Can I convert EPS to JPG Ignoring clipping path?

Post by pjvedder »

Thanks for the quick reply, fmw42. Unfortunately, none of those methods work, and I'm still left with the same resulting jpg.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Can I convert EPS to JPG Ignoring clipping path?

Post by fmw42 »

when I do

convert GoldRings2.eps -strip GoldRings2a.eps

and look at the verbose info (identify -verbose image), the clipping path is gone in the latter. When displayed the two images look very different as the -strip has changed the image between rgb and cmyk (so one needs to add -colorspace rgb)

I am on IM 6.7.0.8 Q16 Mac OSX Tiger.

I cannot say what is going on as I have never used clipping paths. But I can say that the clipping path and other additional info has been removed by -strip.


Likewise the clipping path is gone in the second of these jpgs:

convert -density 72 GoldRings2.eps GoldRings2.jpg
convert -density 72 -colorspace rgb GoldRings2.eps -strip GoldRings2b.jpg

though the images look very similar.

Sorry I really know little about clipping paths, so these are just tests for me.

P.S. From http://www.imagemagick.org/script/comma ... #clip-path

Clip along a named path from the 8BImageMagick profile.

So it would appear that IM gets the clipping path from the 8BIM profile and not the xml clipping path in your file:

identify -verbose GoldRings2.eps
...

Clipping path:
<?xml version="1.0" encoding="iso-8859-1"?>
<svg width="2325" height="1450">
<g>
<path style="fill:#00000000;stroke:#00000000;stroke-width:0;stroke-antialiasing:false" d="
M 231.9,842.837
C 231.9,842.837 219.905,938.705 297.872,1014.6
C 375.838,1090.5 637.726,1136.43 827.644,1140.43
C 1017.56,1144.42 1313.55,1099.77 1369.41,954.683
C 1399.4,876.791 1375.41,792.906 1375.41,792.906
C 1375.41,792.906 1390.67,812.769 1408.31,812.769
C 1425.96,812.769 1440.39,799.143 1440.39,799.143
C 1440.39,799.143 1454.03,807.96 1470.07,810.365
C 1486.11,812.769 1488.51,811.968 1488.51,811.968
C 1488.51,811.968 1507.76,828.8 1533.43,827.999
C 1559.09,827.197 1561.5,818.38 1561.5,818.38
L 1569.52,811.166
C 1569.52,811.166 1580.74,816.777 1588.76,816.777
C 1596.78,816.777 1604,811.968 1604,811.968
C 1604,811.968 1616.83,821.587 1631.27,823.19
C 1645.71,824.793 1662.55,826.396 1662.55,826.396
C 1662.55,826.396 1685,835.213 1705.05,828.8
C 1725.1,822.388 1719.49,803.952 1719.49,803.952
C 1719.49,803.952 1809.31,783.112 1829.36,771.089
C 1849.41,759.066 1862.25,749.447 1867.86,716.584
C 1873.47,683.72 1873.47,656.468 1873.47,656.468
C 1873.47,656.468 1880.69,633.223 1838.19,609.176
C 1795.68,585.13 1688.21,536.235 1366.61,487.341
C 1045.01,438.447 972.025,439.248 927.915,469.707
C 883.805,500.166 902.251,510.586 902.251,510.586
C 902.251,510.586 887.013,516.197 887.013,528.22
C 887.013,540.243 889.419,545.854 889.419,545.854
C 889.419,545.854 884.607,553.87 883.003,572.305
C 881.399,590.741 879.795,588.336 879.795,588.336
C 879.795,588.336 725.811,582.725 583.054,605.97
C 440.298,629.215 239.92,661.688 231.9,842.837 Z
M 350.474,854.45
C 350.474,854.45 494.032,764.677 707.365,767.081
C 920.697,769.486 1058.13,780.29 1190.17,832.808
C 1268.77,864.069 1259.94,868.076 1259.94,868.076
C 1259.94,868.076 1156.49,954.643 792.377,954.643
C 428.268,954.643 350.474,854.45 350.474,854.45 Z
"/>
</g>
</svg>


Profiles:
Profile-8bim: 14630 bytes
Profile-exif: 294 bytes
Profile-xmp: 4649 bytes
...
Post Reply