Fitting an Image to a certain frame

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
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Post by glennrp »

You have to decide how you want to do that. Several choices:

1. Scale the image down to fit the smaller dimension, then stretch to fill the void.
2. Scale the image down to fit the smaller dimension, then fill the void with background color.
3. Scale the image down to fit the larger dimension and crop off the excess.

Any of those are pretty easy if you understand the "geometry" parameter.

Glenn
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

See IM Examples Thumbnails.
Thumbnails usally have to fit in a specific sized area and their are many ways to arrange that.

http://www.cit.gu.edu.au/~anthony/graph ... nails/#fit
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply