Tuesday, December 11, 2012

Resize a list of images in line command

for file in *.jpg; do 
  convert -resize 800x600 -- "$file" "${file%%.jpg}-resized.jpg"; 
done
 
OR 
 
ls *.jpg|sed -e 's/\..*//'|xargs -I X convert X.jpg whatever-options X-resized.jpg 
 
 
# .jpg files, 10% size, no rename, it will overwrite the old pictures
#!/bin/bash
for i in *.jpg; do convert $i -resize 10% $(basename $i .jpg).jpg; done

No comments:

Post a Comment