99 Text Compressor
Project Title:
File Compressor Using C Programming.
Project Members :
S. M. Shaiful Alam (19)
Md. Saiful Islam (29)
Sayef - Rayhan [csedu-18]
99 Text Compressor
Sometimes file takes some extra spaces
unnecessarily even though it doesnt need at
all. For that reason we have to carry more
size of that file and it wastes memory of our
hard-disk or any other memory drives. So
we are going to write a program that will
compress size of any type of files i.e. text
file, image file, video file etc so that we can
save memory spaces in some extent.
Sayef - Rayhan [csedu-18]
99 Text Compressor
Lessening memory is one of the
most important issue of computer
science. So far computer scientist are
working regarding this vital issue. For
that reason weve already found some
work on file compressing using different
algorithms in different times. Zip file is
one of that which compresses different
types of file to reduce memory and
decompresses when needed to be
executed.
Sayef - Rayhan [csedu-18]
99 Text Compressor
1. Windows Operating System
2. Integrated Development Environment
(IDE) for C language i.e. Microsoft
Visual C++, CodeBlocks etc.
Sayef - Rayhan [csedu-18]
99 Text Compressor
So far weve seen that many algorithm and
development
process
have
been
implemented in this regard. Most used and
famous algorithm is Huffman Algorithm.
We are also going to implement this
algorithm in C language. The entire
development process are briefly described
here
Sayef - Rayhan [csedu-18]
99 Text Compressor
Huffman coding assigns shorter codes to symbols that
occur more frequently and longer codes to those that occur
less frequently. For example, imagine we have a text file
that uses only five characters (A, B, C, D, E). Before we
can assign bit patterns to each character, we assign each
character a weight based on its frequency of use. In this
example, assume that the frequency of the characters is as
shown in Table 1.
Sayef - Rayhan [csedu-18]
99 Text Compressor
Figure 1 Huffman coding
Sayef - Rayhan [csedu-18]
99 Text Compressor
Figure 2 Final
tree[csedu-18]
and code
Sayef - Rayhan
99 Text Compressor
Let us see how to encode text using the
code for our five characters. Figure 3
shows the original and the encoded text.
Figure 3 Huffman
encoding
Sayef - Rayhan [csedu-18]
99 Text Compressor
The recipient has a very easy job in
decoding the data it receives. Figure
4 shows how decoding takes place.
Figure Huffman
decoding
Sayef - Rayhan
[csedu-18]
99 Text Compressor
Sayef - Rayhan [csedu-18]
99 Text Compressor
We have implemented the
algorithm using C programming
and successfully compressed and
decompressed text file.
Sayef - Rayhan [csedu-18]
99 Text Compressor
Here, we have a text file named sample.txt.
Size of main file : 49427 bytes
Size of compressed file : 28886 bytes
Reduced size : 20541 bytes
Percentage of the saving memory : 41.558%
Sayef - Rayhan [csedu-18]
99 Text Compressor
We have reduced memory about 41%
percent. So we think, we are in the
track as our plan. If we can modify
our thoughts in different part of our
code, we hope we can reduce size
more than present.
Sayef - Rayhan [csedu-18]
99 Text Compressor
Thank you
Sayef - Rayhan [csedu-18]