Skip to content
Advertisement

Resize a list of images in line command

I would like to resize a list of images, all in the directory. To achieve that, I use convert from imagemagick. I would like to resize

JavaScript

into

JavaScript

I was wondering if there is a method to achieve this in a single command line. An elegant solution could be often useful, not only in this case.

EDIT:

I would like a non script-like solution, ie. without for loop.

Advertisement

Answer

JavaScript

You can eliminate the sed and be extension-generic if you’re willing to accept a slightly different final filename, ‘resized-image1.jpg’ instead of ‘image1-resized.jpg’:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement