-extent stretches clipping paths
Posted: 2011-01-09T22:40:55-07:00
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:
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.
Code: Select all
convert 'filename.psd[2]' -format JPG -background white -depth 8 -resize 600x600\> -extent 1000x1000 -gravity center -quality 100 'filename.jpg'
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.