Resize images from the command line !!
Have you ever found yourself in a trouble of opening softwares such as GIMP even to just resize a single image? This holds very true for me as I regularly upload my images from cameras and other devices into blogs and social engineering websites such as facebook, hi5 and uploading the original image directly can demand a lot of upload bandwidth. So why not just resize the image to about 75 or 50 % of the original and upload onto the websites which consequently does no bad to overall image quality.
For doing this, programs such as GIMP and other image editing tools may not be the best method due to their high memory consumption. So I have come across a very handy command-line tool available for performing this task, and it is called “imagemagick”. In order to install this, type the following code in the terminal:
sudo apt-get install imagemagick
Once installed, you can now resize any image just by writing a line in the terminal. Let us suppose you want to resize an image named “image_large.jpg” to 50% of its original size and name the resized image to “image_resized.jpg”. For doing this, in the terminal, type the following code:
convert -resize 50% image_large.jpg image_resized.jpg
If the image you want to resize is located in the desktop, you should give the path accordingly. The following command does the job for this:
convert -resize 50% /home/user/Desktop/image_large.jpg /home/user/Desktop/image_resized.jpg
Note that the file named “image_resized.jpg” is the new resized file and can be given any name according to your choice.
You can even resize the image to the size greater than the original by giving attributes such as 120% or anything like that, but doing so may reduce the quality of the resized image.
This is how I normally resize my images as it not only saves time but also becomes helpful when you have a low configuration desktop which finds programs such as GIMP to run very hard. If you have any better way of resizing images, please share them in the comments section below.


