Page 1 of 1

trim, then scale, distorting aspect ratio

Posted: 2006-04-10T01:28:53-07:00
by zikko
Hello!

I want to do two simple operations on images. Trimming and resizing.

Using -trim and -resize separately works fine. The problem occurs when I use both. When the amount of white space trimmed off the image is not the same on the four sides, the following resize distorts the aspect ratio of the image.

My spontanious guess is that the rescaling is based on the original aspect ratio of the image rather than on the aspect ratio of the trimmed image.

The following two does not output identical images:

convert "logo.jpg" -trim z.jpg
convert "logo.jpg" -trim -resize 100% z.jpg


There's probably some option or something I can stick in there to fix this, right? :)

Posted: 2006-04-10T08:11:19-07:00
by magick
Add +repage after -trim to get the expected results.