0% found this document useful (0 votes)
27 views

File Compression With Questions

Uploaded by

Lara Haider
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

File Compression With Questions

Uploaded by

Lara Haider
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

AY 2023-2024

Subject: Computing Handout

Name: _________________________Year: 9 Section: ____ Date: _________________

Learning Objectives:

 Understand the types of file compression


 Differentiate between lossy and lossless compression methods.
 Analyse the practical applications and considerations associated with compression techniques.
Unit: 2 Topic: Compression

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:

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.

What Lossless File Formats Are & Why


You Shouldn’t Convert Lossy to Lossless
@CHRISBHOFFMAN
UPDATED SEP 5, 2017, 9:30 PM EDT | 5 MIN READ

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.

Instead, our camera or smartphone converts the image to a JPEG file.


JPEG files are much, much smaller than RAW images. When you
convert RAW to JPEG, some of the image data is “thrown out”,
producing a much smaller file. The conversion process uses a
compression algorithm that works well for photos, allowing them to
look fairly good in spite of the compression. You may still see
compression artifacts, depending on the quality setting.

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.

Image from Wikimedia Commons

Why You Should Never Convert


Lossy to Lossless
When you convert a file from a lossless format to a
lossy format—say, ripping an audio CD (a lossless format) to
MP3 files (a lossy format)—you’re throwing away some of the
data. The MP3 file is so much smaller because much of the
original audio data has been lost.

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.

Conversion from lossless formats


to lossless formats works well,
however. For example, if you rip
an audio CD (lossless) to FLAC
files (lossless), you’ll end up with
files as good as the original audio
CD. If you later converted those
FLAC files to MP3 files—say, to
shrink them down so more of
them will fit on an MP3 player—you’ll end up with MP3 files that are as good as MP3 files ripped from an
audio CD directly.

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/

The Difference between Lossy and Lossless Compression


• Categorized under Software,Technology | The Difference between Lossy and Lossless
Compression

“Lossy” and “Lossless” are


terms used to describe
two different kinds of
compression. This article
will explore the
differences, pros and cons
of each compression type.
Lossy
Compression
Lossy compression lowers a file’s quality. When compressing, an algorithm scans for and
tosses out files it deems unnecessary.

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.

Unless you value top quality – then lossless is best.


I had a photographer friend with a serious storage problem, because of how
much data RAW images take up. They took hundreds, sometimes thousands of photos
every day. Each of these was around 25MB and more.

You do the math.


File Types

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.

Less crucial documents can safely be converted to lossy file types.


Innovations in video

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?

Have you worked with other lossless video?

Let us know in the comments!

Summary
Lossy Lossless

Loses quality to save space Keeps quality at the expense of space

Image files include JPEG and GIF Image files include RAW and PNG

Audio files include MP3 and OGG Audio files include WAV and FLAC

Recommended for less crucial files Recommended for critical files

https://www.pdfreaderpro.com/blog/the-importance-of-file-compression

Why is File Compression Important?


Thu. 07 Apr. 202214874

It is no exaggeration to say that almost everyone who uses a computer


for business or study has used file compression. But in daily use, most of
us usually find the target file > right-click it > compress it with one click,
and then transfer or share it, as if that's as good as it gets. However, file
compression has more benefits than you might expect. First, let's take a
look at what file compression is.

1. What is File Compression?


2. Why is File Compression Needed?

What is 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.

Why is File Compression Needed


Save Storage Space
If you are a photography enthusiast, there are thousands of pictures in
the folder. Maybe your computer memory is large enough to store so
many photos, but the number of photos will continue to increase in the
future. Do you have to wait until the day when the memory is full to
manage documents? Compressing folders can not only prevent problems
before they occur, but also save more space for you to store other
valuable content, and there will be no lag when using your computer.

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.

Prevent Transmission Interruption


File compression increases data transfer speed. Not all office locations
offer high-speed internet, and even a system that can handle a lot of
data transfers can still slow down when many users connect to it at the
same time. The longer the file takes to send, the more likely the transfer
will be interrupted. The time required to transfer a compressed word file
is one tenth of the time required to transfer the same uncompressed file,
which will greatly reduce the risk of unexpected interruptions, and
guarantee your work efficiency.
Ensure Data Security
File compression can also hide information. Not all computers can read
the information stored in compressed files and list them in the file index.
In addition, it is also a good choice to pack multiple files containing
sensitive information with compression software and then add a
password.
Meet Server Requirements
On some Internet servers, file compression is mandatory. The server
operator may not allow the transfer of uncompressed files. File
compression is also useful when sending email attachments, which
often have file size limitations.
In the workplace, it is inevitable to
encounter the problem that the file
cannot be sent due to the size of the

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

You might also like