I would like to know how to resize images in Ubuntu. What is the easiest tool to do so?


15 Answers 15


First, install ImageMagick via:

sudo apt-get install imagemagick

Then, open a terminal and run this command:

convert -resize 20% source.png dest.jpg

It will reduce the size to 20%, not by 20%.
The resulting image will be much smaller, 20% of the former size, and not 20% smaller than before.

You can also specify the size in pixels:

convert -resize 1024X768 source.png dest.jpg

You can also use: mogrify command-line tool from the same package.

  • 7
    the command reduces the size to 50%, not by 50%. Commented Nov 15, 2017 at 17:06
  • @MatthiasWeiler those are identical, not sure what you mean Commented Jan 1, 2018 at 0:08
  • 13
    They are only identical for the special case of 50%. -resize 10% makes your image 90% smaller. Commented Jan 10, 2018 at 15:08
  • if you get an error "no images defined.." it is probably because you did not define destination image... e.g. in the above example, dest.jpg is a must :) Commented Jan 11, 2018 at 3:07
  • you talk about mogrify too; here the differences: deparkes.co.uk/2015/03/16/useful-imagemagick-commands
    – mattia.b89
    Commented Jan 11, 2019 at 18:23

nautilus-image-converter is a nautilus extension to mass resize or rotate images. To install nautilus-image-converter in all currently supported versions of Ubuntu open the terminal and type:

sudo apt install nautilus-image-converter

It adds two context menu items in nautlius so you can right-click and choose "Resize Image". (The other is "Rotate Image").

You can do a whole directory of images in one go if you like and you don't even have to open up an application to do so.

You need to restart your nautilus to see new context menus, run nautilus -q and then click the Home folder icon to reload nautilus with the new plug-in.

  • 2
    Does not work in Ubuntu 13.10 :(
    – malisokan
    Commented Nov 11, 2013 at 17:28
  • 4
    It works on Ubuntu 14.04. Thanks. Commented Aug 22, 2014 at 8:41
  • 11
    I think you need to log out or reboot after installing it--or just do what I did; run pkill nautilus and then click the Home folder icon to reload nautilus with the new plug-in.
    – Lambart
    Commented Mar 31, 2015 at 22:12
  • 3
    ...or just run nautilus -q as someone added to the answer since my last comment. :)
    – Lambart
    Commented Dec 12, 2016 at 18:54
  • 3
    Downvoted because this requires interacting with a GUI, even though OP asked for a command-line tool.
    – byxor
    Commented Dec 30, 2018 at 21:15
sudo apt-get install imagemagick

The command mogrify overwrites the original files with the resized images:

mogrify -resize 50% *.png      # keep image aspect ratio
mogrify -resize 320x240 *.png  # keep image aspect ratio
mogrify -resize 320x240! *.png # don't keep image aspect ratio
mogrify -resize x240 *.png     # don't keep image aspect ratio
mogrify -resize 320x *.png     # don't keep image aspect ratio

Note: You can add -auto-orient to automatically orient converted images.

  • Don't keep aspect ration with convert: convert hospital.jpg -resize 2000x! hospital_2000.jpg
    – Adobe
    Commented Oct 5, 2013 at 22:15
  • 2
    Perfect and simplest possible answer with both situations. love it !
    – navderm
    Commented May 14, 2015 at 19:02
  • 4
    the initial images are replaced with the new resized ones. in case you need the initial ones, make a backup
    – user47206
    Commented Oct 26, 2016 at 8:53
  • 320x does keep image aspect ratio. It sets the height to the appropriate value, thus the ratio is kept. Maybe you confused something here?
    – phil294
    Commented Jun 13, 2022 at 15:05
  • Better compressed result is with optipng ref
    – Nam G VU
    Commented Nov 10, 2022 at 8:21

If you're just doing a couple of images, most image editors in Ubuntu (Gimp, F-Spot, etc) will let you do a basic resize.

If you want to edit tens, hundreds or thousands of images, I prefer Phatch. Phatch is a GUI-based batch photo editor that will let you perform a whole load of transformations on images. sudo apt-get install phatch

ImageMagick is good but it's a bit tedious if you don't know the setting names for things. You can very quickly learn Phatch by clicking around.

  • F-Spot does resize? Where?
    – Martin
    Commented Jul 23, 2013 at 11:17
  • While installing phatch my Chrome Browser got closed and I was unable to relaunch it, I had to remove phatch and other packages it installed to get chrome back to working state.
    – mallaudin
    Commented Apr 25, 2017 at 19:12

ImageMagick is the package you want. It contains a number of useful command line tools for this very purpose.

Here's a simple tutorial explaining how to batch resize images:-

mogrify -resize 320x240 *.jpg

After this command is completed, all of the images will be replaced with resized version of themselves. Notice that in an effort to preserve the image aspect ratio, mogrify may not be produce images that are exactly 320x240. To force this to happen, modify the original command to by placing an exclamation point at the end of the desired resolution:

mogrify -resize 320x240! *.jpg
  • Better compressed result is with optipng ref
    – Nam G VU
    Commented Nov 10, 2022 at 8:21

No need to install any new software just do this

convert -resize 50% myfigure.png myfigure.jpg


convert myfigure.png -resize 200x100 myfigure.jpg
  • 6
    No new software - except for imagemagick, the package that contains convert. Commented Dec 24, 2019 at 18:29
  • Better compressed result is with optipng ref
    – Nam G VU
    Commented Nov 10, 2022 at 8:21

At the moment nautilus-image-converter does not work in Ubuntu 13.10. Therefore I use imagemagick on the command line, which is very good workaround (at least for me).

sudo apt-get install imagemagick

Keep in mind the difference between these imagemagick tools:

  • Mogrify does processing on the same image, it reads file modify file and writes the output to the same file.
  • Convert is meant to work on separate images, reads file and modify and write to different file/format. You can also use convert command to use output file same as input file.

I often use mogrify to simply resize multiple images and overwrite the original files. I. e. this command would scale down the dimension of all JPG files to 40% of the original dimension:

mogrify -verbose -resize '40%' *.JPG
  • Better compressed result is with optipng ref
    – Nam G VU
    Commented Nov 10, 2022 at 8:22

GIMP is probably the easiest way, since it has a fairly simple UI for such common tasks. All you have to do is open up your image and go to Image → Image Size and then change accordingly. There are ways to do batch resizing using the GIMP as well, but I don't know them by heart.


Install gthumb. Simple and easy for basic image handling and editing functions - viewer, resizing, cropping, rotate, flip, grayscale, etc with options to save in JPEG, PNG, TIFF, TGA formats.

To install gthumb:

  • Open your terminal
  • Type sudo apt-get install gthumb
  • Accept the changes
  • 1
    On Linux Mint, it was optimal solution for me. Commented Dec 18, 2013 at 12:29
  • I am used to rotate my photos with gthumb. Commented Dec 28, 2014 at 19:44
  • Please add the hint to your solution that you can set under gthumb->preferences->Viewer the zoom behaviour after (re)loading an image. Works great with svg files too. Reale saved my life when working with figures generated from matplotlib...
    – newandlost
    Commented Sep 9, 2020 at 11:23

You can also use the ubiquitous ffmpeg (or avconv) tool to resize images:

ffmpeg -i image.jpg -s 4096x2048 image-resized.jpg

And if you want really fast JPEG image resizing - try epeg (as mentioned here and there) - which needs to be built from source.

  • The quality is very good compared to convert and mogrify from ImageMagick. This is my favorite one.
    – fsevenm
    Commented Sep 16, 2019 at 10:02
  • Better compressed result is with optipng ref
    – Nam G VU
    Commented Nov 10, 2022 at 8:22

There is a good multiplatform tool called XnConvert. Combine and choose between more than 80 different operations. The installation is simple through deb. file from the official website.

It is free but not opensource, perhaps that's just the beauty of it.

enter image description here


For GUI, Phatch "one click is worth thousand photos" is the best for such quick job. It is already in Ubuntu repository. It has plenty of actions and options as imagemagick.

sudo apt-get install phatch


Phatch project is DISCONTINUED unfortunately, last code commit was on 2011-01-24. It is on LP/Launchpad (Frameworks: Python2/PyGTK2.8)

  • 1
    Not available to install for Ubuntu 20.04.2; gives "E: Unable to locate package phatch"
    – brewmanz
    Commented Feb 24, 2021 at 8:14
  • 1
    @brewmanz It is was discontinues, and pygtk2.8 was dropped from repository.
    – user.dz
    Commented Feb 24, 2021 at 15:23

open the image in ImageMagick.

  1. click on the image command box will be open.
  2. view->resize enter the pixel you want. click on resize button.
  3. File-> save, enter the name. click on Format button choose the format you want and click select button.
  4. click on save button.

another option is select view -> original image and Drag the corners of the image to resize it. select File -> save.


I use Pimagizer. It works great and it is the easiest application I have used. Tested on Ubuntu 14.04, 15.04, 15.10.

sudo add-apt-repository ppa:vfrico/stable
sudo apt-get update
sudo apt-get install pimagizer

See : https://launchpad.net/pimagizer/ for more infos.


The script to resize all .png files in a folder to 30%. The original file can either be removed (if delete_original is true), or stays, in that case the resized file would get a name postfix rename_postfix:


for str in *.png; do
    #reverse strings
    reverse_str=$(echo $str | rev)
    reverse_substr=$(echo $substr | rev)
    #find index of reversed substring in reversed string
    #calculate last index
    index=$(( ${#str} - ${#substr} - $reverse_index ))
    # Extract the filename without extension
    if $delete_original; then
        # the name can remain, because the original will be removed
        # need a new name, two files will remain

    echo "extension = ${substr}, original = ${str}, filename = ${filename}, new = ${new_filename}"
    # Resize and convert the file to .jpg
    convert -resize 30% "${str}" "${new_filename}"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .