Install
sudo apt-get install imagemagick
Resize
convert source.png -resize 600x600 output.png
Replace/overwrite original source
mogrify -resize 600x600 source.png
Resize all PNG files in directory and replace original source
mogrify -resize 600x600 *.png
-resize
Original aspect ratio is always respected.
-resize 600x600
- max width and max height is 600. If original image is1200x600
, it shall be resize to600x300
. If original image is300x150
, it shall be upsize to600x300
.-resize 600
- max width and max height is 600-resize 600x300
- max width is 600 and max height is 300. If original image is600x600
, it shall be resize to300x300
.-resize 600x600\>
- will prevent upsize. If the original image is300x300
, the original size remain as it is smaller than600x600
.
References: