You can resize multiple image files (jpg/png/gif….) stored in a folder by the imagemagick package. Here is step-by-step guideline:
Install ImageMagick
1. Install imagemagick from Ubuntu Software Center
Or, in the terminal:
sudo apt-get install imagemagick
Copy all of your images to a folder
2. Put all your image files in a single directory.
And don’t forget to take backup of your photos in a separate location.
3. Open a terminal and go to this directory:
cd <directory-location>
4. Now, enter following command to resize all of the images to a specific percentage. For examples, for the following command, all of the images will be reduced to 50% of their dimension maintaining the ratio.
mogrify -resize 50% -format jpg *
Where -format jpg specifies: the resultant format will be JPG.
Specify exact width & height
You may also specify width and height by the following command:
mogrify -resize 800x600 -format jpg *
You can easily guess, the resultant images will be of width 800 px and height of 600 px, keeping the original ratio.
Just mention width
Just mention width and the height will be automatically calculated, maintaining aspect ratio:
mogrify -resize 800x -format jpg *
That is, we told imagemagick that we want the images to be 800 pixels width. Height will be calculated automatically.
Full documentation here
Quite a beautiful website. I built mine and i was looking for some design ideas and your website gave me some. Did you develop the website alone?
Hi….thanks for this good information.I’m so happy because it’s very useful for my thesis research.I hope you will keep updating your content constantly as you have one dedicated reader here 🙂
Thanks. Glad to know the article was helpful 🙂
Just found this info – just what I was after 🙂 Thanks.
Thanks!
Just what I needed.
Thanks!! Exactly what I was looking for!
Thanks man! Thats helped me resize image for my blog post.
Thanks mate. Works a treat. Beer on it’s way…………..
Thanks for the great tip how to resize images in bulk, very useful info…
Just what I needed. Thanks!
Thanks for the info!! Just the one that i was lookong for!!
Thank you very much.
Thanks for the info. Works like a charm 😉
is there ability to change compression level also?
This is exactly what I needed to get some files ready to share on my blog and facebook. I shoot in RAW so I also needed to install ufraw and ufraw-batch packages to get this to work. Being able to resize my RAW files and convert them to jpg from the command line is wonderful! Thanks so much 🙂
Very useful when prepare image galleries to publish on the Web. Thanks a lot.
Thank you for this! I can now perform a batch image resize in my blog.
Thnx!
Great tool to prepare images for web publication with! Thanks
Hi Thank you so much for sharing such a useful post.
Would you please help me with one small question, Currently the resized image also is created in the same folder, would you please share the comment to create the resized image in a new folder so that I wont have it mixed up..
As of IM v6.2.0 you can also use a new “-path” option to specify a different directory in which to output the processed images. This make it safer, however it will still overwrite any images of the same name that may already be in that directory.
Thanks. Very handy.
Wow. Man you saved my day. I ve like a million images to resize, and php is slow. Shell should do the trick
If I wanted to resize to a width of X but allowing the height to keep to the original ratio what then?
From the documentation:
“The “mogrify” command is in many ways like “convert” except it is designed to modify images in place. That is it’s primary purpose is to read images (or animations), one file at a time, and modify them, before saving the image back into the exact same filename the image was read from. Because of this…
Mogrify is dangerous, as it can easily destroy the original image!
As such, before you do anything final, test “mogrify” with a separate copy of your images. Do not do use it on an original image that has no backup.”
This was great to convert hundreds of pictures taken from a 12 Megapixel camera to 1920×1080 format for quick viewing on our Full HD TV (without having to wait for the TV to resize pictures one by one). Thank you very much!
This is a great article. Good Job