I just discovered a neat way to resize an image from the command line. No doubt many people who might read this blog are already aware of it, but just in case it is new for anyone else I thought I would share it here.

I uploaded my image to accompany posts here on club-ubuntu.org but I found that it was too large; the image actually obstructed the text on the front page. Airtonix's image seemed to be the perfect size so I right clicked on it and selected properties. Under the image tab I found the width and height dimensions of his icon. It turned out his icon had a width of 39 pixels and a height of 60 pixels. Now how to make mine the same size?

I didn't want to install gimp for such a small task so I went looking for a way to do it from the command line. After using cd to navigate to the directory containing my image named em.png, the following command did the trick:

 em@leibniz:~/Desktop$ convert -resize 39x60 em.png em-resized.png

This created a new image in my /Desktop directory called em-resized.png that had a width of 39 pixels and a height of 60 pixels just as desired!