The image resolution capability of today’s photo capturing devices like smartphones and digital cameras is increasing day by day. The real deal comes when we have to share these images, upload them on a cloud, or even save them on a device with restricted storage. Graphic designers also have to deal with the same issue but they are well-equipped with tools that can compress the images so that they can be easily shared with the stakeholders.

For Debian users, the simplest and the most efficient solution to this issue is the Trimage image compressor. Trimage is a cross-platform GUI and command-line interface to optimize image files via optipng, advpng, pngcrush, and jpegoptim, depending on the filetype (currently, PNG and JPG files are supported). All image files are losslessly compressed on the highest available compression levels. Trimage gives you various input functions to fit your own workflow: A regular file dialog, dragging and dropping and various command line options.

In this article, we will explain how you can install Trimage on your Debian both through the UI and the command line. We will then explain how you can launch and use this tool to losslessly compress images through your Debian.

We have run the commands and procedures mentioned in this article on a Debian 10 Buster system.

Install Trimage through the Debian UI

Installation

For a person who does not want to open the Command Line much, installing software present in the Debian official repository through the UI is very simple. On your Debian Activities toolbar/Dock, click the Software icon.

Debian Software center

In the following view, click on the search icon and enter Trimage in the search bar. The search results will display the Trimage Image Compressor as follows:

Select Trimage package

This is the package maintained by Debian Stable Main repository. From the Software Manager, click on the Trimage entry to open the following view:

Trimage Image Compressor

Click the Install button to begin the installation process. The following authentication dialog will display for you to provide your authentication details as only an authorized user can install software on Debian.

Authenticate as admin

Enter your password and click the Authenticate button. After that, the installation process will begin, displaying a progress bar as follows.

Installing Trimage

Trimage will then be installed to your system and you will get the following message after a successful installation:

Launch Trimage

Through the above dialog, you can choose to directly launch Trimage and even Remove it immediately for whatever reason.

Remove Trimage

If you want to remove Trimage that was installed using the above method, you can remove it from your system as follows:

Open the Debian Software Manager and search for Trimage. You will see the “Installed” status in the search entry. Click this entry and then click Remove from the following view:

Uninstall Trimage

Then, the system will prompt you with an Authentication dialog. The software will be removed when you provide the password for sudo user and click Authenticate on the dialog.

Install Trimage through the Debian Command Line

Installation

Trimage image compressor is easily available in the official Debian repositories and can easily be installed through the command line using the apt-get command.

Open the Terminal application by pressing the Super(Windows) key and searching for it through the Application Launcher as follows:

Open Debian Terminal

Login as root by entering su and then the password for root. You are now authorized to add/remove and configure software on Debian. Now, enter the following command in order to update the local repository index with that of the Internet. This helps you in installing the latest version of a software available online.

# sudo apt-get update

Update package lists

You are now ready to install Trimage; enter the following command as root in your Terminal:

$ sudo apt-get install trimage

Install Trimage with apt

The system might ask you the password for sudo and also provide you with a Y/n option to continue the installation. Enter Y and then hit enter; the software will be installed on your system. The process may, however, take some time depending on your Internet speed.

You can check the version number of the application, and also verify that it is indeed installed on your system, through the following command(as non root):

$ trimage --version

Remove Trimage

In case you want to remove the Trimage application through the command line, run the following command as sudo:

$ sudo apt-get remove trimage

Removing Trimage

Enter y on the y/n prompt and the software will be completely removed from your system.

How to Use Trimage for Image Compression

You can access Trimage from the Debian application launcher bar as follows, or directly access it from the applications listing:

Trimage Icon

Alternatively, you can use the following command in your Terminal to launch Trimage through the command line:

$ trimage

This is how the Trimage UI looks like:

Trimage Image Compressor

It lets you add image(s) for compression in two ways:

  • Through the Add and compress button that lets you browse to the images you want to add
  • By dragging and dropping the images to the Trimage window

Add Images that shall be compressed losslessly

I have added a file through the Add and compress button and Trimage has automatically compressed it by 30.6 %, and that too losslessly. You can even try Re compressing your photos further if they have more potential to be optimized, otherwise the tool will skip compressing the images.

This was all about the simplest image compressor for Debian, that does the job perfectly well.

Lossless Image Optimization with Trimage on Debian 10 Desktop