How can i compress the text file using huffman encoding?

10 views (last 30 days)
Hi
I am using a text file to hide inside an image file in lsb plane. But i want to compress the text file using huffman encoding and hide inside the lsb plane of image file. After retrieve the text file, the text file should be decompressed using huffman encoding.
Can you help in this matter.
  1 Comment
Prakruthi gowda
Prakruthi gowda on 3 Feb 2018
Hi I took steganography as my project using lsb and lsb+huffman coding can anyone help me with correct matlab codes for encoding and decoding and mail me @prakruthi.1110@gmail.com

Sign in to comment.

Accepted Answer

Massimo Zanetti
Massimo Zanetti on 27 Sep 2016

More Answers (3)

Walter Roberson
Walter Roberson on 27 Sep 2016
Edited: Walter Roberson on 27 Sep 2016
  9 Comments
Walter Roberson
Walter Roberson on 29 Sep 2016
The output of the execution of what is not clear? Please clarify what you mean by not clear.
Sanjeeb Behera
Sanjeeb Behera on 3 Oct 2016
Edited: Walter Roberson on 3 Oct 2016
Here i have given execution code of above program
At first it require to read the file i.e paper4
Then it needs to enter the destination huffman code file name: paper5
Enter huffman table: table
Enter the destination file: paperx
paper5, table and paperx file created but no data is saved in this file.
So can u help me, how can i get correct result?

Sign in to comment.


Usairum Mirza
Usairum Mirza on 16 Oct 2019
Edited: Usairum Mirza on 16 Oct 2019
A simple and easy way for encoding and decoding with a text file is give below:(We have used huffman functions in this code).
keep in mind make your text file in capital letters and with no nex line or comms or fullstop
  2 Comments
Ateeb Khawaja
Ateeb Khawaja on 19 May 2020
but in this code Encoding is not mentioned. its only decoding
Usairum Mirza
Usairum Mirza on 3 Jun 2020
Edited: Usairum Mirza on 10 Jul 2020
By making a dictionay assigning their probabilities and using huffman commands like huffman enco this is where encoding part is. Also after running we can see the compression ratio or number of bits that are compressed just look it up.

Sign in to comment.


Sai Sriram Sunkavalli
Sai Sriram Sunkavalli on 29 Aug 2020
Consider the given file(James C. Maxwell.docx). Compute the probabilities of alphabet and number (ratio of the number of occurrences to the total count of alphabets and numerals) and create a table with symbols and probabilities. Determine the Huffman code for the symbols and create the table of symbols and Huffman codewords. Using the above constructed table encode your name and Roll number.

Categories

Find more on Denoising and Compression in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!