Ubuntu image manipulation commands

image tool

Resize image (and convert)

First, install imagemagick:

1
2
sudo apt-get update
sudo apt-get install imagemagick --fix-missing

Image resize command:

1
2
3
convert source.jpg -resize 200x100 target.jpg
convert -resize 50% source.jpg target.png
convert -resize 600x source.jpg target.jpg

Compress or Optimize images

For JPG images:

1
2
sudo apt-get install jpegoptim
jpegoptim test.jpg

For PNG images:

1
2
sudo apt-get install optipng
optipng filename.png

Share