Cropping all images to uniform size....
Cropping all images to uniform size....
Is it possible to use Crop() so that if you have an image that is smaller than the size you're changing it to, that it will expand the image to that size? I'd prefer that the extra area be white.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Cropping all images to uniform size....
there is a little trick. crop the image as normal, but add a '!' flag. This makes the virtual canvas from crop that same size as the crop. The images offset is set to poistion the image in this area right too.
now set the background and flatten it. the flatten will fill out the image to the virtual canvas size, and set the backgound to the color given (can be transparent if you like).
now set the background and flatten it. the flatten will fill out the image to the virtual canvas size, and set the backgound to the color given (can be transparent if you like).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/