-extent stretches clipping paths

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
evant
Posts: 2
Joined: 2011-01-09T22:17:53-07:00
Authentication code: 8675308

-extent stretches clipping paths

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Contact:

Re: -extent stretches clipping paths

Post by fmw42 »

do you get any improvement by putting -gravity center before -extent?
evant
Posts: 2
Joined: 2011-01-09T22:17:53-07:00
Authentication code: 8675308

Re: -extent stretches clipping paths

Post 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)
elioengcomp
Posts: 1
Joined: 2014-02-21T13:39:17-07:00
Authentication code: 6789
Contact:

Re: -extent stretches clipping paths

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests