Explaining File Compression Formats

Computer Science
96 followers
#rar #Zip #7z
Zip and other file compression formats explained, including 7z, rar, gz, bz2, xz, and compressed tar files. Video also covers the related applications PKZIP, 7-Zip, WinZip, WinRAR/RAR, GZip, XZ Utils, and BZip2.
Chapters:
00:00 Introduction
00:42 Achieving File Compression
04:48 Myriad Formats
08:28 Software Options
12:50 Compression Efficiency
14:23 Wrap
AI Generated·May contain errors
Video Summary
AI GeneratedThis video provides a comprehensive overview of file compression, covering its history, the difference between lossy and lossless methods, and a comparison of various formats and software tools. It explains how compression reduces file size by identifying data patterns and discusses the practical applications of archiving and password protection across different operating systems.
Welcome to another video from explainingcomputers.com.
This time, I'm going to talk about zip
and other file compression formats.
This will include a bit of history
as well as discussing the software required
to create and access different formats of compressed file
in different operating systems.
So, let's go and get started.
File compression reduces the size of a file
to create a smaller version that uses less space.
Often, the compressed file is in an archive format
which means it can include multiple files.
File compression methods can be lossy or non-lossy.
In lossy compression,
such as the process used to make JPEG image files,
some data is discarded.
However, this video is about non-lossy file compression
which maintains all data
by identifying repeated data patterns
and replacing them with codes that take up less space.
File compression methods have been in development
since the 1940s.
For example, in 1952,
David A. Huffman published a paper
called A Method for the Construction
of Minimum Redundancy Codes.
This described a technique now known as Huffman coding
which uses fewer bits of data
to encode information patterns that occur more frequently.
In 1977 and 1978,
Abraham Lempel and Jacob Ziv
also published seminal papers
that defined lossless compression methods
called LZ77 and LZ78.
These are known as dictionary or substitution coders
as they replace repeated data patterns
with a reference to an entry in a dictionary
that is created during the compression process.
And like Huffman coding,
LZ77 and LZ78 still form the basis
of many of today's data compression standards.
Talking of which, in 1986,
Phil Katz founded a company called PKWare
to create data compression software.
In 1989, PKWare introduced
a lossless file compression format called ZIP
along with a DOS program called PKZip
to compress and decompress ZIP files.
PKWare also released the ZIP file format
into the public domain,
so enabling its widespread use.
ZIP is an archiving format
that permits the use of a number of compression algorithms,
the most common of which is Deflate,
which uses a combination of LZ77 and Huffman coding.
In the 1990s, PKZip became available for Windows.
And as we can see from the early days,
it allowed ZIP files to be password protected.
And indeed, still today,
if you want to email or otherwise transfer some files
with an added level of security,
a decent option is to create a password protected ZIP file.
Since Windows ME,
Windows has natively included the option
to create a ZIP file.
It is, however, worth noting
that if you want to create
a password protected ZIP file in Windows,
you'll need to use commercial software
such as PKZip or WinZip
or a free open source application such as 7Zip.
And we'll compare these
and other file compression programs later in the video.
Meanwhile, since Windows ME,
the functionality to access non-password protected ZIP files
has been built in to all versions of Windows.
Beyond Windows, ZIP compression and decompression
is included in iOS, macOS, Linux and FreeBSD.
For example, in a modern Linux distro,
to create a ZIP file,
we just select content and right click
followed by compress.
Exactly what options are available
will then depend on the distro.
But here in Zorin OS 17,
we can create a standard or password protected ZIP file
or alternatively a tar.exe or 7Z file.
And this leads us to the subject
of other file compression formats.
Alongside ZIP,
many other file compression formats are in common use.
Detailing all of these
would make this video very long indeed.
So let's run through some of the most common
before summarizing which applications can create
and access them and comparing compression efficiency.
In 1992, Jean-Luc Gailly and Mark Adler
released the GZIP format and software for the GNU project.
GZIP files have a GZ extension
and use the deflate compression algorithm
commonly used in ZIP.
However, unlike ZIP, GZIP is not an archiving format
so can only compress a single file.
In 1993, Eugene Rochal created
the Rochal Archive Format or RAR.
While this remains proprietary,
the license allows anybody to create software
capable of decompressing RAR.
So lots of file compression packages can read RAR files.
However, RAR files can only be compressed
using commercial applications such as WinRAR from RAR Lab.
Back in the public domain in 1999,
Igor Pavlov released a free file compression application
called 7ZIP, which has a native archiving compression format
called 7Z.
7Z can use a number of different compression algorithms
including LZMA and LZMA2.
LZMA stands for the Lempel-Ziv-Markov chain algorithm,
is based on a variant of LZ77
and was also created by Igor Pavlov.
LZMA2 compression is faster than LZMA
as it makes better use of multiple processor cores.
LZMA also has its own non-archiving file compression format
with the extension LZMA.
A free set of command line tools called XZUtils,
previously called LZMAutils, can create LZMA files.
XZUtils also has its own XZ native format,
which is non-archiving and uses LZMA compression.
BZIP2 is another open source file compression utility.
It has the native format BZ2
and uses a compression algorithm
called Burrows-Wheeler-Transform or BWT.
Next on our non-exhaustive list,
we come to compressed TAR files.
In 1979, the TAR or Tape Archive Format
was developed by the AT&T Bell Labs.
As this suggests, TAR was created to package files together
for storage on tape and is not a file compression format.
However, TAR files are often compressed
using a variety of methods.
For example, GZIP can be used to create compressed TAR files
with a TGZ or TAR TGZ extension
and TAR XZ and TAR B2Z files are also common.
Finally, it's worth noting that in 2008,
the WinZip file compression program
introduced a new version of the ZIP format called ZIPX.
This stands for ZIP Extended
and creates smaller files by using XZ compression.
So, which file compression format should you use?
Well, the two key factors to consider
are how your files will be compressed and decompressed
and how efficient the compression will be.
Not that many years ago,
it was also worth considering the time
and computing resources required
to compress and decompress data.
But with modern hardware,
this is unlikely to be a significant concern
or constraint for most users.
As we've noted, all mainstream operating systems
can create and access ZIP files.
In general, Windows has the weakest native support
for other formats,
although in October 2023,
Microsoft issued an optional update for Windows 11 22H
that added the ability to access
many more compression formats,
including 7Z, GZ, RAR, TAR TX and TAR B2Z,
providing that the files are not password protected.
However, if you want to create compressed files in Windows
in a format other than ZIP,
or if you want to create password protected ZIP files,
additional software is needed.
So, let's look at the capabilities
of those applications mentioned earlier.
Firstly, we have PKZIP,
which can be used to create ZIP files
and is commercial software with a free trial.
For desktop users,
the program is available for Windows and Linux
and like all popular file compression applications,
as we can see here,
it can decompress a lot of other file formats
in addition to its own ZIP files.
Moving on, WINZIP is a commercial Windows application
with a 21 day free trial.
The package can create ZIP and ZIPX files
whilst being able to access
most other compressed file formats.
Next is 7ZIP, which is a free open source application
for Windows, Linux and Mac.
The package can create ZIP
as well as its own 7Z format files,
as well as being able to access
loads of other compressed file formats.
And for most users,
7ZIP is my recommended file compression application.
Moving on, we come to WINRAR for a Windows PC,
which is also available under the name RAR
for macOS, Linux, FreeBSD and Android.
This is again a commercial application with a free trial,
but it's far less intrusive when you install it
than for example, WINZIP.
The package can compress RAR and ZIP files
as well as being able to open many other formats
as we can see here in its settings screen.
And personally,
if I was going to purchase a file compression application,
it would be WINRAR.
Lastly, we get to GZIP, XZUtils and BZIP2,
all of which are command line utilities
and all of which are pre-installed in most Linux distros.
Here, for example, we're working with GZIP in a terminal
where if I press enter,
we will compress the final typeset file
for my book, Digital Genesis.
And there we are, it's done.
And if we do a list like that,
we can see the original file at the top
and the compressed GZ file beneath that.
Similarly, we could also compress the file using XZUtils
like this, very similar syntax.
Just change GZIP there to XZ like that.
Takes a little bit longer, but it will complete.
There we go.
Or we could compress using a BZIP2,
pretty much same again.
There we are.
And if we again do a list like that,
we can see all three compressed files
with the XZ compressed file being the smallest
and the GZ file the largest.
And this brings us to the subject
of file compression efficiency
using different file compression formats.
Greetings, here we are back in Zorin OS
where I've been using the functionality
in the file manager to create compressed files
of this sample content,
which is about 90 megabytes in size.
And I've already created 7Z and TARXZ files.
So let's now create a ZIP file,
just a right click and then compress.
ZIP is our default here.
I'll just change the name.
There we go.
And there we are.
We now have a ZIP file.
So we just close that down like that.
We can see we've now got three compressed files.
And earlier I used WinRAR to create a RAR file
of the same content.
So let's just paste that in as well.
There it is.
And so now we have four compressed files.
There they are of the same content.
And as we can see, the ZIP file is the largest
followed by the RAR file and the TARXZ file
with the 7Z file being the most efficiently compressed.
Now, it's extremely important to note
that different formats and algorithms
work best on different types of content
and that some formats
can use different compression algorithms.
So our results here are very much just indicative
based on one set of content and compression settings.
However, they hopefully provide an illustration
of the relative efficiency
of four of the most common file compression formats.
Today, drive capacities and online transfer speeds
have never been greater.
And therefore, our need to use compressed file formats
is not as critical as it once was.
This said, compressed archiving formats
like ZIP or 7Z or RAR remain important
not just to save space,
but also to allow us to bring together
lots of files in one container
that can potentially be password protected.
But now that's it for another video.
If you've enjoyed what you've seen here,
please press that like button.
If you haven't subscribed, please subscribe.
And I hope to talk to you again very soon.
