Re-sizing multiple images on Linux

Every time when I have some task which is quite laboriousness and requires a lot of manual intervention, I think of some sort of automation. I think that because what I have understood during all my digital experience, that I am not the first one to be hit by these kind of boulders all along. At the same time, I am also not the only one who thinks that way when they are challenged with things like these. And finally, a lot of those people are way more smarter than I am for solving these problems. And what's even more better is, they share their learning and experiences. I just love the open source family... :k

Right, back to this post. Recently, my sister got married and as expected, a lot of pics were captured. I had specifically bought Nikon L810 for it, and god, what images does it capture. But, you can't upload those high -resolution images for sharing with your friends. That's about 10G of images and in countries like mine, that size is a pretty high volume.

So, what what the task at hand? You guessed it right, trim down the image sizes to be smaller. From 5MB image sizes, I need to clip it down to KBs. I have been using Adobe Photoshop for this, but lately my Windows doesn't work quite much. Crashes all the time. So, I was left with Gimp.

So, I started with it. I got this DBP plugin for GIMP which would have solved my problem right away. But the source files didn't work out. I didn't have much time for getting into the debugging make install problems. I kept on searching. Somewhere on one of the Linux forums, I got this url for ImageMagick. I got to know that, there is a command in linux (convert) which directly does that without any utility. I wrote a sample shell script for it and Voila, just a piece of cake or walk in the part. :-P

Here is the script.
for file in *.jpg; do
    convert -resize 800x800 "$file" "../small/sm_$file"
done


Doesn't get any simpler than this. :e 8) 8|

Comments

Popular posts from this blog

Personal Contact Manager

An apt quote

Alone