{"id":7125,"date":"2021-06-12T12:58:25","date_gmt":"2021-06-12T12:58:25","guid":{"rendered":"https:\/\/linuxways.net\/?p=7125"},"modified":"2021-06-12T12:59:41","modified_gmt":"2021-06-12T12:59:41","slug":"how-to-optimize-images-in-linux-using-trimage","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-optimize-images-in-linux-using-trimage\/","title":{"rendered":"How to Optimize Images in Linux Using Trimage"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Why would one optimize images in Linux? For sure to make 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\u2019t 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.<\/p>\n<p>In this guide, I will help you to install and operate a piece of software that will change the way you used to optimize your images on your system. I am using the Debian 10 Buster edition and all the commands work for related variants. You should still not be running commands without understanding your operating system-related instructions.<\/p>\n<h2>Install Trimage<\/h2>\n<p>Installing Trimage on Debian is as simple as installing any regular package. Simply follow along with the commands given below, and you\u2019ll be all set.<\/p>\n<pre>$ <em>sudo apt update<\/em><\/pre>\n<pre>$ <em>sudo apt install trimage<\/em><\/pre>\n<p>There aren\u2019t any dependencies to make the installation complicated anyway. This will install both GUI and CLI setups.<\/p>\n<h2>Meet Trimage<\/h2>\n<p>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 <em>.deb<\/em> format to install packages. It offers both CLI and GUI-based user interfaces.<\/p>\n<p>Let\u2019s do some magic here:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"608\" height=\"204\" class=\"wp-image-7126\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-355.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-355.png 608w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-355-300x101.png 300w\" sizes=\"auto, (max-width: 608px) 100vw, 608px\" \/><\/p>\n<p>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.<\/p>\n<p><strong>At this time, Trimage only optimizes PNG and JPG formats. It can always be enhanced if you know how to code.<\/strong><\/p>\n<p>Let\u2019s optimize a full directory of images now.<\/p>\n<p>We are selecting a full directory as shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"81\" class=\"wp-image-7127\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-356.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-356.png 783w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-356-300x31.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-356-768x79.png 768w\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" \/><\/p>\n<p>Trimage will list all the images and begin the process as you can see in our screenshot.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"264\" class=\"wp-image-7128\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-357.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-357.png 686w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-357-300x115.png 300w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/p>\n<h2>Trimage On CLI<\/h2>\n<p>Trimage is as simple on CLI as in GUI.<\/p>\n<p>With the help of a few commands, you can reduce the size of an unlimited number of images in a directory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"670\" height=\"452\" class=\"wp-image-7129\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-358.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-358.png 670w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-358-300x202.png 300w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/p>\n<p>The best way to optimize images via CLI is to run the below command from a directory and you are good to go:<\/p>\n<pre><strong>$<\/strong> <em>trimage -d . -q<\/em><\/pre>\n<p>You\u2019ll get optimum results with less clutter.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>In this article, we learnt how simple it can be to optimize any type of JPEG and PNG images to save some precious disk space on your computer. We are always happy to guide you through your difficult issues here on LinuxWays. It\u2019ll be a pleasure to have your feedback for a greater motivation to bring the best of Linux.<\/p>\n<p><strong>You might Read<\/strong><\/p>\n<p><a href=\"https:\/\/linuxways.net\/de\/centos\/best-photo-editors-for-linux\/\">Best Photo Editors for Linux<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction Why would one optimize images in Linux? For sure to make some space to let some new family photos let in or make room for new images&hellip;<\/p>","protected":false},"author":1,"featured_media":7237,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[364,363,100],"class_list":["post-7125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-optimize-images","tag-trimage","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=7125"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7125\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/7237"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=7125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=7125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=7125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}