Need help resizing
Posted: 2010-07-10T13:12:39-07:00
Hi. I have an image that's 1680x1050 that I want to convert to 1280x1024. The original image was some oddball resolution that was resized to 1680x1050 so it has pillarboxes. I am currently doing:
mogrify -resize 1280x1024 -gravity center -background black -extent 1280x1024 image.jpg
Problem is, it doesn't create it the way I want. I made examples:

First is the source image. The mogrify output is the second image. What I want is the third image. Basically, it's compressing X and Y of the image to fit the desired res, whereas I want it to resize to 1024 then crop the edges. I figured OK, just calculate the ratio for 1024 (0.8) so I'd divide 1050 by 0.8 to find the same ratio horizontal spec (1312.5). I tried:
mogrify -resize 1313x1024 -gravity center -background black -extent 1313x1024 image.jpg
..but that still gave me letterboxing. What would be the proper way to go about this? Thanks!
mogrify -resize 1280x1024 -gravity center -background black -extent 1280x1024 image.jpg
Problem is, it doesn't create it the way I want. I made examples:

First is the source image. The mogrify output is the second image. What I want is the third image. Basically, it's compressing X and Y of the image to fit the desired res, whereas I want it to resize to 1024 then crop the edges. I figured OK, just calculate the ratio for 1024 (0.8) so I'd divide 1050 by 0.8 to find the same ratio horizontal spec (1312.5). I tried:
mogrify -resize 1313x1024 -gravity center -background black -extent 1313x1024 image.jpg
..but that still gave me letterboxing. What would be the proper way to go about this? Thanks!