How To Optimize Images In Linux

February 28, 2014 | By
| 1 Reply More

Sometimes we need to optimize our images so they can take up less disk space and load faster in our websites. A very nice and easy to use tool for everyone that can help us optimize our image files for the web by removing EXIF, other metadata and unnecessary comments is Trimage. This image optimizing program is inspired by ImageOptim which is another open source program used to optimize images files in machines that run Mac Os X.

How To Install Trimage In Linux

Before installing the Trimage program in your machine make sure that your machine meets the following requirements:

  1. python 2.6
  2. python-qt4 4.4
  3. optipng 0.6.2.1
  4. pngcrush 1.6.7
  5. advancecomp 1.15
  6. jpegoptim 1.2.2

Debian And Ubuntu

To install Trimage in Debian and Ubuntu just type the following command.

sudo apt-get install trimage

As you can see from the above command, we use the apt-get commandline utility to install the Trimage image optimizer program because it is included in the official repositories.

Arch Linux

Trimage is available from AUR. Arch users have to type the following command in order to install the program in their machine.

yaourt -S trimage-git

Mandriva Linux 2010.1

Trimage is available Via two RPMs provided by Mandriva international backports Trimage 1.0.5 32bit Trimage 1.0.5 63bit

OpenSuse

Trimage is available for a variety of versions: 11.3, 11.4 and Factory and SLE. You can find them on software.opensuse.org.

Install Trimage From Source

But if you are the type of linux geek that likes to experiment with commands in the termina then you can install Trimage from source by downloading it via git or bzr. Download the Trimage's repository from github as a zip file by using the following command in your terminal.

wget https://github.com/Kilian/Trimage/archive/master.zip

Unzip the zip file with the following command.

unzip master.zip

Change directory so you can install Trimage.

cd Trimage-master

Then enter the following command in your console to install Trimage.

python setup.py install

Note: This will not work if you have not instaled the requirements.

How To Use Trimage

After the installation of the tool is finished you can launch it directly from the terminal with the trimage command or by going to Applications, Graphics and then select and click on Trimage image compressor. You will be presented with a very small window that makes the tool look very easy to use, even for people that are novice computer users.

If you come from a Mac OS X background and are familiar with the ImageOptim tool you will see that the tools look like they are the same app. The two following screenshots are taken in Mac OS X and Ubuntu machines. The first one shows ImageOptim tool running in a mac computer and the second one in an Ubuntu Linux machine.

how to optimize images in linux ImageOptim running in Mac OS X. how to optimize images in linux

Trimage running in my Ubuntu Linux box. At the moment I am writing this article the Trimage program supports only PNG and JPG image files and many planned features are expected to be included in the near future. To compress an image file with Trimage image compresser program just click on the Add and compress button like shown in the following picture.

how to optimize images in linux

Select the image you want to optimize and double click on it. The program will automatically start the compression and at the end will give you information about the old size of the image, the new size and the compression amount.

Filed Under : HOWTOS, OPEN SOURCE TOOLS

Free Linux Ebook to Download

Comments (1)

Trackback URL | Comments RSS Feed

  1. Vagelis says:

    Thank you Oltjano Terpollari. Very useful article! Trimage makes an excellent job with size reduction.

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.