×


Optimize Images in Debian 10 Linux System Using Trimage

What is the need to optimize images in Linux?

The reason is to allow some space to let some new family photos let in or make room for new images for web development reasons. The possibilities are unlimited. It doesn't matter what your purpose is to optimize images, but if your tools are not doing what they were supposed to do, you are missing something.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related files optimization queries.

In this context, we shall look into  to install and operate a piece of software that will change the way you used to optimize your images on your Debian system.


How to Install Trimage on Debian ?

To Install Trimage on Debian is as simple as installing any regular package. Simply follow along with the commands given below, and you'll be all set:

$ sudo apt update
$ sudo apt install trimage

There aren't any dependencies to make the installation complicated anyway. This will install both GUI and CLI setups.


More about Trimage ?

Trimage is the image compressor for the Linux world. It can optimize images for web use. All image files are losslessly optimized on the highest available compression level. All EXIF and other image metadata are removed. Trimage is free open-source software available for Debian, Ubuntu, and related distributions that use .deb format to install packages. It offers both CLI and GUI-based user interfaces.

Trimage has a straightforward graphical user interface. It takes an unlimited number of images and compresses them in the blink of an eye. You can always recompress them with a single click until the image can no longer be compressed.

By default, Trimage only optimizes PNG and JPG formats. It can always be enhanced if you know how to code.

To optimize a full directory of images, you can select a full directory.

Trimage will list all the images and begin the process.


How to use Trimage On CLI ?

Trimage is as simple on CLI as in GUI.

With the help of a few commands, you can reduce the size of an unlimited number of images in a directory.

The best way to optimize images via CLI is to run the below command from a directory and you are good to go:

$ trimage -d . -q

You'll get optimum results with less clutter.


How to Verify Trimage Installation ?

After Trimage installation, we will be able check the version number of the app and with this we will also confirm that everything was installed correctly in our system using the following command:

$ trimage --version

Now for launch the program from the terminal, we will only have to run in the terminal:

$ trimage


Trimage Command line options

To get help with using Trimage, simply run the command:

$ trimage -h
  • -version → Shows the number of program version.
  • -h, –help → Shows the program help.
  • -v, –verbose → Verbose mode (predetermined).
  • -q, –quiet → Silence mode.
  • -f FILENAME, –file = FILENAME → compress the image and comes out.
  • -d DIRECTORY, –directory = DIRECTORY → compress images in directory and comes out.


How to Uninstall Trimage from Debian Linux System ?

In case we want remove Trimage application via command line, we will have to execute the following command:

$ sudo apt remove trimage


[Need to Install any Software Package on Debian System ? We can help you. ]


Conclusion

This article covers how to optimize any type of JPEG and PNG images to save some precious disk space on your computer. 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 image files in machines that run Mac Os X.


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

$ sudo apt-get install trimage