Tip : Optimize images on Ubuntu Linux

When working with a lot of images by example for galleries on a website, it could be really interesting to optimize the images to save a lot of space and directly improve the performances of the website and save some traffic if this is limited by your hosting.

Optimize JPEG images with jpegoptim

A great tool to optimize JPEG images is jpegoptim. It's a simple command line tool available as Ubuntu package. You can install it easily :

sudo apt-get install jpegoptim

And it's also really simple to use. First, to optimize an image without loss :

jpegoptim image.jpg

Or with a loss of max 25% :

jpegoptim --max=75 image.jpg

More informations on the official site.

Optimize PNG, BMP and GIF images with optipng

An other tool to optimize other types of images is optipng. Here again you can install it with apt-get :

sudo apt-get install optipng

It's as easy as the first tool :

optipng image.png

You can also configure the tool to use the best optimization level, but also the slowest :

optipng -o7 image.png

So here we are : You have now enough informations to optimize all you images on Ubuntu. I hope this will be useful to somebody.

Related articles

  • Tip : Batch resize images on Ubuntu Linux
  • Tip : How to switch from KUbuntu to Ubuntu
  • Ubuntu Lucid Lynx (10.04) is here !
  • Ubuntu Lucid Lynx Tip : Put the window buttons to the right
  • How to profile your applications using the Linux perf tools
  • Install the Insight Debugger on Linux Mint (works for Ubuntu too)
  • Comments

    Comments powered by Disqus