zulhfreelancer
2/20/2018 - 5:16 AM

How to resize photos size in bulk using CLI/Terminal?

How to resize photos size in bulk using CLI/Terminal?

$ cd /path/to/photos/folder
$ image-batch-resizer --directory . --size 500 --remove-original-file yes

To auto-rename res_xxx.jpg to xxx.jpg (original file name), run:

for i in "res_"*;do mv "$i" "${i#"res_"}";done

$ cd /path/to/photos/folder
$ image-batch-resizer --directory . --size 500 --remove-original-file yes && for i in  "res_"*;do mv "$i" "${i#"res_"}";done

If you have Terminal alias called ibr, this is the shorter version of the command above:

$ ibr -d . -s 500 -R yes && for i in  "res_"*;do mv "$i" "${i#"res_"}";done

Dependencies

  • brew install imagemagick
  • yarn global add image-batch-resizer

References