File Compression With Questions
File Compression With Questions
Learning Objectives:
Task:
Resource Credits:
https://www.howtogeek.com/142174/what-lossless-file-formats-are-why-you-shouldnt-convert-lossy-to-lossless/
Solve the questions using any digital tool and submit the file in the assignment.
1. Explain the primary purpose of file compression and its work? Provide examples of
situations where file compression is particularly useful?
2. Explain the key differences between lossy and lossless compression methods?
3. How does file compression impact the quality of the compressed data, and why is this
an important consideration?
4. What are the potential drawbacks or limitations of using lossy compression methods?
Give examples of common applications or scenarios where lossless compression is
preferred over lossy compression?
5. In what situations would you recommend using lossy compression for data storage or
transmission?
6. How do common lossy and lossless formats differ in terms of their efficiency and
effectiveness for various types of data (text, images, audio, and video)?
7. Explain the trade-offs between file compression and file decompression in terms of
computational resources and time?
8. Prepare a table showing the common lossy and lossless formats for Text, Images, Audio
and Video.
9. Why is compression needed? (There are 5 points at the end of this article)
Page 1
(Save storage space, archive documents, increase data transfer speed, ensure data security,
meet server requirements)
Reading Activity:
Whether you’re dealing with images, music, or video files, it’s important to understand the difference between
different types of formats and when to use them. Using the wrong format could ruin a file’s quality or make its
file size unnecessarily large.
Some types of media file formats are “lossy” and some types are “lossless.” We’ll explain what these terms
mean, the advantages of each type of file format, and why you should never convert lossy formats to lossless
ones.
Compression Explained
We use compression to make files smaller, allowing them to download faster and take up less storage space. For
example, when you take a photo, your camera captures all the light it can get and puts together an image. If you
save the image in RAW format, which keeps all the light data the camera’s sensor received, the image may be
Page 2
as large as 25 MB. (This depends on the resolution of the image—a camera with more megapixels will produce
a larger image.)
If we’re just uploading these files to a social network or placing them on a website, we don’t want these image
files to take up so much space. A photo gallery with RAW images could take up hundreds of megabytes of
space. RAW formats may be used by professional photographers to
keep image quality high during the editing process, but they’re not
intended for the average person.
Note that lossy formats generally have a setting that controls how
lossy they are. For example, JPEG has a variable quality setting. Low
quality makes a smaller JPEG image file, but the quality of the image is noticeably worse. Below is a close-up
example of a very lossy JPEG—you can see various “compression artifacts.”
Lossless vs. Lossy Formats
We call RAW a “lossless” format because it preserves all of the file’s original data, while we call JPEG a
“lossy” format because some data is lost when we convert an image to JPEG. However, these aren’t the only
formats that are lossy and lossless.
Images: RAW, BMP, and PNG are all lossless image formats. JPEG and WebP are lossy image formats.
Audio: WAV is a container file often used to contain lossless audio, although it is also capable of containing
lossy audio. FLAC is a lossless audio format, while MP3 is a lossy audio format.
Video: Few lossless video formats are in common consumer use, as they would result in video files taking up
a huge amount of space. Common formats like H.264 and H.265 are all lossy. H.264 and H.265 can provide
smaller files with higher qualities than previous generations of video codecs because it has a “smarter”
algorithm that’s better at choosing the data to throw out.
Some of these lossless formats also provide compression. For example, a WAV
file typically contains uncompressed audio, and takes up quite a bit of space. A FLAC
file can contain the same lossless audio as a WAV file, but uses compression to keep
create a smaller file. Formats like FLAC don’t throw any data away — they keep all
the data and compress it intelligently, like ZIP files do. However, they are still
significantly larger in size than MP3 files, which throw much data away.
RELATED
When Is Lossless Audio Streaming Actually Worth It?
A conversion can be lossy even between lossless formats. For a conversion to actually be lossless, the data from
the original file must fit inside the destination file. For example, lossless FLAC files only support 24-bit audio.
If you converted a WAV file containing 32-bit PCM audio to FLAC, the conversion process would have to
Page 3
throw out some data. The conversion process between a WAV file containing 24-bit PCM audio to FLAC
would be lossless.
In the below image, the bottom version of the photo is compressed with a poor-quality lossy compression
algorithm. It will be noticeably smaller in file size than the above image.
If you converted the lossy MP3 file to a lossless FLAC file, you
wouldn’t get any of that data back. You’d get a much larger
FLAC file that’s only as good as the MP3 file you converted
from. You can never get the lost data back. Think of it like
taking a perfect copy of a photocopy. Even if it was possible to
create a perfect copy of a photocopy, you would still end up
with a photocopy, which isn’t as good as the original document.
This is also why it’s a bad idea to convert lossy formats to other
lossy formats. If you take an MP3 file (a lossy format) and convert it to OGG (another lossy format), more of
the data will be thrown away. Think of this like taking a photocopy of a photocopy—each time you photocopy a
photocopy, you lose data and the quality becomes worse.
Page 4
Which Should You Use?
When you should use lossless formats and when you should use lossy formats depends on what you’re using
them for. If you want a perfect copy of your audio CD collection, you should rip them to lossless files. If you
want a copy to listen to on your MP3 player and file size is more important, use a lossy format instead.
If you want to put a photo on the web, you should use a lossy format to reduce that photo’s size. (but keep a
backup of the original lossless file) If you’re printing the photo professionally, you’ll probably want to use a
lossless format during the editing process. (Note that, for screenshots, PNG is a lossless format that can create
appropriately-sized, sharp screenshots out of the flat colors found on computer screens. However, PNG
becomes much larger if it’s used for photos, which contain much more jumbled up colors from the real world.)
We can’t possibly cover all of the situations you’d choose a media file format for. Just be aware of the trade-
offs when selecting a file format.
http://www.differencebetween.net/technology/the-difference-between-lossy-and-lossless-compression/
Page 5
Lossy compression is used when a file can afford to lose some data. It is useful because it
saves space. As long as space is not a problem, it should not be necessary to use lossy
compression.
Lossless Compression
Lossless compression, as you may have guessed by now, is used when quality is of utmost
importance. The higher quality comes at a cost of larger file size.
Photographers enjoy using lossless compression, as many use RAW images. This is a form
of lossless compression for images. These gigantic files are perfect for editing and fine-
tuning in Photoshop.
Once the photoshop edit is complete, the image is converted to JPEG (or similar) at high
quality. This is then presented to the client.
Which is best?
There is no “best”. It depends on what you plan to do with your files and how much
storage space you have available.
A few lossy file types used for images are JPEG’s and GIF’s. Both of these lose some quality
at conversion.
Files types RAW, BMP and PNG are all forms of lossless compression. They keep their
quality at the expense of huge storage space.
In audio lossy files are MP3, MP4 and OGG. Lossless files are WAV, FLAC and ALAC (used
by itunes).
Page 6
In video there are few lossless file types. The sheer (and shocking) size of lossless video file
types make them almost inaccessible to mere mortals. Lossless video files, I’d imagine, are
used by major movie studios.
I guess there could be YouTubers that use lossless video. I don’t know. (If you’re a
YouTuber and reading this, leave your thoughts in the comments!)
Actual Conversion
If you don’t mind losing quality, it’s fine to convert from lossless to lossy. It is a viable
option when running out of space or when the need to have the lossless files has passed.
Converting from lossy to lossless is not advised. The quality won’t improve, since the
unnecessary files deleted will never return. But the file size will grow significantly.
If the file is then returned to lossy compression, further quality loss will occur.
Converting from one lossy file type to another is also not recommended, as more quality
will be lost with each conversion.
More tips for converting files
Whenever you have a crucial document (like financial data), it is recommended to keep a
lossless file format. Any files where a great loss of quality would incur costs or damages,
the files should be kept in lossless format.
Videos commonly come in the MWV or MKV file types. There’s a new file type, however,
called H.264.
I haven’t seen this file type myself yet, but, apparently, it’s better than MWV. It has a
better algorithm which decided what to chuck, and ends up with smaller, higher quality
files.
According to pavtube, the MKV file format is lossless. Personally I doubt this, as I recently
had MKV video files. The video itself was great, but the audio was pretty poor.
Page 7
Have you worked with MKV or H.264 file formats?
Summary
Lossy Lossless
Image files include JPEG and GIF Image files include RAW and PNG
Audio files include MP3 and OGG Audio files include WAV and FLAC
https://www.pdfreaderpro.com/blog/the-importance-of-file-compression
Page 8
File compression is a method of data compression that reduces the
logical size of files to save disk space for easier and faster transmission
over the network or Internet. It can create one or more versions of files
with the same data that are much smaller than the original file.
Compression techniques can be divided into lossless compression and
lossy compression. Lossless compression algorithms reduce the file size
without losing any information in the file, which means that we can
reconstruct the original data from the compressed file. Lossy
compression algorithms reduce file size by discarding less important
information in the file, which can significantly reduce file size. For
example, the contents of a file are 11100000000... 000001111(with
10,000 zeros in the middle) would be very long if written out at all, but if
written as 11110,000 zeros 1111, you get the same information but
with much shorter characters, thus reducing the size of the file. File
compression is also known as file zipping.
Archive Documents
Page 9
Compression tools are also great for archiving old files. You will always
have many files that you can't use everyday but can't delete. You can
compress any number of files of the same type into a single file and add
corresponding notes to them, which will simplify your file system.
Page 10
file. Especially the PDF file, which is widely used now because of its
portability, has the highest usage rate among all file formats. When the
volume it occupies is too large, we usually compress the file. When you
receive a compressed PDF file, what should you do after decompressing
it?
Page 11