Top Banner
File Compression Using Huffman Algorithm Developed By : Mansuri Amin R. (MCA-20) Vaja Rajesh K. (MCA-59) Guided By: Prof. H. N. Shah. Assistant Professor, MCA Department, DDU, Nadiad Submitted To : Faculty of Management & Information science, Faculty of Technology. `
42

File Compression Using Huffman Algorithm_2003

Oct 22, 2014

Download

Documents

shastri shastri
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: File Compression Using Huffman Algorithm_2003

File Compression Using Huffman Algorithm

Developed By : Mansuri Amin R. (MCA-

20) Vaja Rajesh K. (MCA-59)

Guided By: Prof. H. N. Shah. Assistant Professor, MCA Department, DDU, Nadiad

Submitted To : Faculty of Management &

Information science, Faculty of Technology.

`

Page 2: File Compression Using Huffman Algorithm_2003

Project Objective

• Support user to compress and decompress text file.

• Provide a Better understanding of Huffman File Compression Algorithm.

• Facilitate user to understand/study the how algorithm is work.

Page 3: File Compression Using Huffman Algorithm_2003

Project Scope

• This project will develop and deliver a new application and this is a s study based project.

• The new application enable you can reduce the size of any text file and allowed data accuracy and save disc space.

• The new application can give the idea and better understanding to who study the Huffman coding algorithm technique we can use in the real life application.

• To make the existing system more efficient.

Page 4: File Compression Using Huffman Algorithm_2003

About Huffman Algorithm

• It was developed by David A. Huffman while he was a Ph.D. student at MIT, and published in the 1952 paper "A Method for the Construction of Minimum-Redundancy Codes".

David A. Huffman

Page 5: File Compression Using Huffman Algorithm_2003

About Huffman Algorithm

• Huffman coding is an encoding algorithm used for lossless data compression.

• Lossless data compression is a class of data compression algorithms that allows the exact original data to be reconstructed from the compressed data.

• The term lossless is in contrast to lossy data

compression, which only allows an approximation of the original data to be reconstructed, in exchange for better compression rates.

Page 6: File Compression Using Huffman Algorithm_2003

Step for Huffman Algorithm

• Scan text to be compressed and calculate occurrence of all characters.

• Sort or prioritize characters based on number of occurrences in text.

• Build Huffman tree based on prioritized list.

• Perform a traversal of tree to determine all code words.

• Scan text again and create new file using the Huffman codes.

Page 7: File Compression Using Huffman Algorithm_2003

Existing System

• Existing system refers to the system that is being followed till now.

• The main disadvantage of this system is that the users depend on third party software's like winzip, winrar, Stuff etc.

• The existing system requires more computational time,

more manual calculations, and the complexity involved in Selection of features is high. .

Page 8: File Compression Using Huffman Algorithm_2003

Drawback Of Existing System

• Deficiency of Data accuracy

• Time consuming.

• The users depend on third party software's like winzip, winrar, Stuff etc.

Page 9: File Compression Using Huffman Algorithm_2003

Proposed System

• The aim of proposed system is to develop a system of improved facilities.

• The proposed system tries to eliminate or reduce difficulties up to some extent. The proposed system is file/folder compression or decompression based on the Huffman algorithm.

• The proposed system will help the user to consume time. The proposed

system helps the user to work user friendly and he can easily do the file compression process without time lagging.

• The system is very simple in design and to implement. The system

requires very low system resources and the system will work in almost all configurations.

Page 10: File Compression Using Huffman Algorithm_2003

Advantage of Proposed System

• The system is very simple in design and to implement.

• The system requires very low system resources and the system will work in almost all configurations.

• Ensure data accuracy and Save disk space

• Minimum time needed for the file compression.

• The user need not depend on third party software's like winzip, winrar, Stuff etc.

Page 11: File Compression Using Huffman Algorithm_2003

Analysis & Design : Use Case Diagram

Huffman System

User

Enter Text or textfile

*

*

Huffman codeword

generate Huffmantree

calculate frequency

«uses»

«uses»

«uses»

Page 12: File Compression Using Huffman Algorithm_2003

Analysis & Design : Sequence Diagram – Enter Text

Page 13: File Compression Using Huffman Algorithm_2003

Analysis & Design : Sequence Diagram - View Result

User UI Huffman System

Enter text

file or folder

Display Frequency of each Symbol

Display probability of symbol

Display Huffman Tree

Display Code Words

Sequence diagram of View Result

Page 14: File Compression Using Huffman Algorithm_2003

Analysis & Design : Activity Diagram: Enter Text

Page 15: File Compression Using Huffman Algorithm_2003

Analysis & Design : Activity Diagram - View Result

Page 16: File Compression Using Huffman Algorithm_2003

Analysis & Design : Class Diagram

Page 17: File Compression Using Huffman Algorithm_2003

UI : First Screen

Note : The first page of System

Page 18: File Compression Using Huffman Algorithm_2003

UI : Operation Menu Screen

Page 19: File Compression Using Huffman Algorithm_2003

UI : Input Menu Screen

Page 20: File Compression Using Huffman Algorithm_2003

UI : Input – Text Menu Screen

Page 21: File Compression Using Huffman Algorithm_2003

UI : Input – New File Menu Screen

Page 22: File Compression Using Huffman Algorithm_2003

UI : Input – Save DialogBox Screen

Page 23: File Compression Using Huffman Algorithm_2003

UI : Input – New File Screen

Page 24: File Compression Using Huffman Algorithm_2003

UI : Input – Open Folder Screen

Page 25: File Compression Using Huffman Algorithm_2003

UI : Input – Open DialogBox Screen

Page 26: File Compression Using Huffman Algorithm_2003

UI : Input – Folder Open Screen

Page 27: File Compression Using Huffman Algorithm_2003

UI : Sample Text

Note : This screen display the file that user choose as open

Page 28: File Compression Using Huffman Algorithm_2003

UI : Result Menu

Note : This screen display all option result menu and user select “Frequency of character option

Page 29: File Compression Using Huffman Algorithm_2003

UI : Frequency of character Table Screen

Note : This screen display frequency of character of currently selected file.

Page 30: File Compression Using Huffman Algorithm_2003

UI : Huffman Tree Screen

Note : This screen display Huffman Tree for currently selected file.

Page 31: File Compression Using Huffman Algorithm_2003

UI : Codeword Screen

Note : This screen display Huffman Codeword for each character in currently selected file.

Page 32: File Compression Using Huffman Algorithm_2003

UI : Encoding Screen

Note : This screen display user select Encoding for currently selected file.

Page 33: File Compression Using Huffman Algorithm_2003

UI : Encoding Screen

Note : This screen display the compress contain of the of currently selected file.

Page 34: File Compression Using Huffman Algorithm_2003

UI : Sample Screen

Note : This screen display the content of Test File.

Page 35: File Compression Using Huffman Algorithm_2003

UI : Compress Test File Screen

Note : This screen display the compress file of test file.

Page 36: File Compression Using Huffman Algorithm_2003

UI : Compress Size screen

Note : This screen display the size of original and compress file .

Page 37: File Compression Using Huffman Algorithm_2003

UI : Decompress Option Screen

Note : This screen display user select Decompress option.

Page 38: File Compression Using Huffman Algorithm_2003

UI: Open Dialog box for tree File Screen

Note : This screen display open dialog box for Huffman tree file.

Page 39: File Compression Using Huffman Algorithm_2003

UI : Open Dialog box for Compress file Screen

Note : This screen display open dialog box for Compress file.

Page 40: File Compression Using Huffman Algorithm_2003

UI : Decompress Screen

Note : This screen display original content.

Page 41: File Compression Using Huffman Algorithm_2003

Bibliography

Books:

• JAVA 2 Complete Reference (5th Edition) By Herbert Schildt• core java volume 1 by horstmann and cornell• core java volume 2 by horstmann and cornell

Web Sites:

• http://en.wikipedia.org/wiki/Huffman_coding• http://www.cprogramming.com/tutorial/computersciencetheory/

huffman.html• http://www.daniweb.com/software-development/c/code/216267• http://www.javaclass.info/generics/queue/priority-queue.php

Page 42: File Compression Using Huffman Algorithm_2003