![]() |
Linux image converter. |
The easiest way for me to compress images on Linux is by using this text-based program. While there may be other GUI options available, I find this text-based tool quite effective. Why? Ease of Use: It’s straightforward and simple to operate, Lightweight: It doesn’t consume much system resources. Let’s explore its features...
Installing The Program
sudo apt-get -y update
sudo apt-get -y install jpegoptim && sudo apt-get -y optipng
![]() |
jpegoptim and optipng installation. |
Compressing An Image With jpegoptim
Let’s say we have a JPEG and PNG image that we need to compress to a smaller size. Please note that more aggressive compression will reduce image quality, so you’ll need to ensure that the compression level meets your needs.
For example, I have a wallpaper named 'Bliss XP.jpg' that I want to compress from 2.1 MB to 250 KB. Let’s proceed:
jpegoptim --size=250k 'Bliss XP.jpg'
![]() |
jpegoptim compress a jpg image. |
Now that the image has been compressed to the desired size, it is ready for use.
Compressing An Image With optipng
For another image, specifically a PNG file (e.g., My Bike Tour.png), we use optipng for compression. Unlike jpegoptim, optipng does not require specifying a target size. The process is as simple as:
optipng 'My Bike Tour.png'
Batch Compressing Files
jpegoptim --size=100k Desktop/Images/*
I understand that Linux might not be everyone's choice, but I wanted to share this information. If you have any difficulties with terminal navigation, you can read this article.
I hope you found this helpful. Have a great day, and see you next time!