Resize Image To Exact Dimensions | Imagemagic

PHP Developer Freelance | E-learning Platform external link
🔗 See other jobs

ImageMagick provides a host of tools like the Convert command for modifying images. The Convert command can be used to resize images. You can resize your images in two ways.

👉 Approximate resizing

Approximate resizing will resize your image to a dimension closer to the one you specified without distorting the image. Convert employs this method by default.

01: $ convert image.jpg -resize 400x400 output.jpg 

👉 Exact resizing

When you use exact resizing, you can resize your image to the exact dimensions you specify. To achieve this you will have to place an exclamation mark at the end of your dimension. Eg: 400x400!

01: $ convert image.jpg -resize 400x400! output.jpg 

Here is another article you might like 😊 "Prevent macOS from creating a .ds_store file"