One-liner #1: Bulk resizing images with ImageMagick convert

This is the start of a series of blog posts about useful one-liners. The first post will be about bulk converting multiple images with ImageMagick convert.

There are multiple ways of doing this, I like the bashism way using a for loop. The following line resizes all images to 50% in your current working directory:

$ for file in *; do convert "$file" -resize 50% "$file"; done

Keep in mind that this will fail if you have files in your folder which convert can't handle. In this case you might want to select just the jpg files (or whatever you want) by using "*.jpg" instead...

comments (0) - add comment

No comments so far, leave one?