Data compression is the process of storing data in a format that uses less space than the original representation would use. Compressing data can be very useful particularly in the field of communications as it enables devices to transmit or store data in fewer bits. Besides reducing transmission bandwidth, compression increases the amount of information that can be stored on a hard disk drive or other storage device.
Lossy compression is a data encoding method which reduces a file by discarding certain information. When the file is uncompressed, not all of the original information will be recovered. Lossy compression is typically used to compress video, audio and images, as well as internet telephony. The fact that information is lost during compression will often be unnoticeable to most users. Lossy compression techniques are used in all DVDs, Blu-ray discs, and most multimedia available on the internet.
Images take up massive amounts of internet bandwidth because they often have large file sizes. They are the most popular resource type on the web. According to the HTTP Archive, the majority of the data transferred to fetch a web page are images composed of JPEGs, PNGs and GIFs.
There is a package named crunch in the Ubuntu repositories but that’s not an image file optimization program (in fact it generates wordlists). In the absence of an Ubuntu package, we took the manual installation approach.
Clone the project’s GitHub repository
$ git clone https://github.com/chrissimpkins/Crunch.git
Change into the newly created directory.
$ cd Crunch
Build and install the software with the commands:
$ make build-dependencies
$ make install-executable
The output from
make build-dependencies is too long to reproduce, so we’ll settle for this image showing the final step.