I am trying to make a tool that will, in imitation of responsive design on the web, make iPhone / iPad wallpapers by taking the largest centered crop-to-device-dimensions it can, and programmatically be available.
I have an original image in landscape, and commands, one per output wallpaper, like:
convert background.png -resize 320x480 -crop 320x480+0+0 background-320x480.png
However, after the conversion, background-320x480.png's dimensions are 320x239, and all of the generated images have the same aspect ratio, notwithstanding that they are intended to cover portrait and landscape resolutions across iPhones and iPads.
The same dimensions appear if I replace the first 480 with a number in the thousands.
What is appropriate use of ImageMagick's convert to shrink a master wallpaper down to the minimum dimensions that will enclose a wallpaper dimension (preserving aspect ratio), and then crop the center of the shrunken master to wallpaper dimensions and preferably center it? Let's say my original is 1600x1200 and I am trying to make a 320x480 wallpaper.