2013-08-22 03:34:11 +02:00
|
|
|
# To resize an image to a fixed width and proportional height:
|
2013-08-11 21:37:11 +02:00
|
|
|
convert original-image.jpg -resize 100x converted-image.jpg
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To resize an image to a fixed height and proportional width:
|
2013-08-11 21:37:11 +02:00
|
|
|
convert original-image.jpg -resize x100 converted-image.jpg
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To resize an image to a fixed width and height:
|
2013-08-11 21:37:11 +02:00
|
|
|
convert original-image.jpg -resize 100x100 converted-image.jpg
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To resize an image and simultaneously change its file type:
|
2013-08-11 21:37:11 +02:00
|
|
|
convert original-image.jpg -resize 100x converted-image.png
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To resize all of the images within a directory:
|
|
|
|
# To implement a for loop:
|
2013-08-11 21:37:11 +02:00
|
|
|
for file in `ls original/image/path/`;
|
|
|
|
do new_path=${file%.*};
|
|
|
|
new_file=`basename $new_path`;
|
|
|
|
convert $file -resize 150 conerted/image/path/$new_file.png;
|
|
|
|
done
|