Page 1 of 1

Clipping certain JPEG files to PNG

Posted: 2011-01-25T03:26:48-07:00
by axelrose
Hello all,

I observe certain JPEG files with a clipping path which don't convert properly.

Normally the following command:

Code: Select all

convert jpg:path-ok.jpg -alpha transparent -clip -alpha opaque -resize 300x300 png:path-ok-clipped.png
does a great job.

Input: http://dl.dropbox.com/u/84530/IM/path-ok.jpg
Output:
Image

But with the following input JPEG I cannot achieve the desired output.
Input: http://dl.dropbox.com/u/84530/IM/path.jpg
Output:
Image

Is this a bug? Is there a workaround by using different options?

I tried IM versions 6.6.1-10, 6.6.6-5 and 6.6.7-2.

Thanks for your time, Axel.

Re: Clipping certain JPEG files to PNG

Posted: 2011-01-25T18:06:50-07:00
by anthony
Looks like the clipping path is the wrong direction.
It may also depend on a specific clipping attribute "fill-rule"
See http://www.imagemagick.org/Usage/draw/#mvg_settings