Page 1 of 1

-extent stretches clipping paths

Posted: 2011-01-09T22:40:55-07:00
by evant
I am converting a number of large PSDs (with intricate clipping paths) to JPGs and need to preserve the clipping paths. I have, however, noticed some odd behavior when using the -extent command option. Here's an example of a command I might run:

Code: Select all

convert 'filename.psd[2]' -format JPG -background white -depth 8 -resize 600x600\> -extent 1000x1000 -gravity center -quality 100 'filename.jpg'
Upon first glance, this will produce a centered image on a white background, as expected. However, when I fire up Photoshop, the clipping paths seem to have been anchored to the "-extent 1000x1000" rather than being tied to the original 600x600 resize. What's produced is a clipping path that is much larger than it should be. The effect is even more dramatic if you were to specify something like "-extent 1000x2000", where the clipping path would be stretched much taller than you'd expect.

I don't know if this is a quirk of PSD conversion, or the way -extent was intended to work, or a bug. The best workaround I can come up with is to extract the clipped layer and save as a transparent PNG. However, this is not ideal for a number of reasons. If anyone has some ideas about how to work around this, I would really appreciate any insights. Thanks.

Re: -extent stretches clipping paths

Posted: 2011-01-10T11:11:22-07:00
by fmw42
do you get any improvement by putting -gravity center before -extent?

Re: -extent stretches clipping paths

Posted: 2011-01-10T11:51:51-07:00
by evant
fmw42 wrote:do you get any improvement by putting -gravity center before -extent?
Good idea. But, no, that doesn't seem to help. Here are the results:

http://etishuk.orangecoat.net/psd/small ... 0x1000.jpg

The original PSD I am testing off of is here, if anyone wants to try it:

http://etishuk.orangecoat.net/psd/small_test.psd (2.4MB)

Re: -extent stretches clipping paths

Posted: 2014-02-21T13:41:52-07:00
by elioengcomp
Hello guys!

Sorry for resurrecting this post, but i'd like to know if you guys found any solution or workaround for this problem.

Thanks in advance.