Clipping certain JPEG files to PNG

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
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Clipping certain JPEG files to PNG

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Clipping certain JPEG files to PNG

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply