Tutorials

How to resize photos in ubuntu with imagemagick

Table of contents:

Anonim

How to resize photos in Ubuntu with ImageMagick. Many times we need to use a photo but it has an inappropriate size for the use we want to give it, to solve this problem we can use a third-party application to modify the size of the image to our liking and thus adapt it to our needs.

How to resize block photos in Ubuntu using ImageMagick and terminal

One of the tools that we can use to resize images is ImageMagick a software that is included by default in Ubuntu but of which very few users are aware, in part because it works exclusively through the terminal although its use is really simple.

We recommend reading our review of Ubuntu 16.04 LTS.

ImageMagick's biggest advantage is that it allows us to resize images in blocks, that is, we can have a folder with a multitude of images and modify them all with a single line in the terminal. First of all we go to the folder that contains all the images that we want to modify, we can do it in a very simple way with the following command:

cd / path / to / the / image

Once we have our terminal in the path of the folder with the images, we only have to enter the command to make the modification, for example suppose we want to modify a batch of.jpg images to a size of 1280 x 720 pixels:

mogrify -resize 1280x720! *.jpg This command will resize all the.jpg files in the folder to a size of 1280 x 720 pixels, if we want to modify images with another extension we only have to change it in the order, for example suppose we want to modify.png images:

mogrify -resize 1280x720! *.png

With ImageMagick we have a very fast and easy-to-use solution to resize images in blocks, on the other hand it does not allow us to convert images to another format, so we will have to use more advanced and complex tools such as Gimp.

Tutorials

Editor's choice

Back to top button