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

Huffman Coding

The document discusses Huffman coding and run-length coding (RLC) as techniques for image compression. Huffman coding optimally encodes symbols to minimize redundancy, while RLC exploits repetitive pixel values by encoding them as runs. Examples illustrate the application of both methods, highlighting their effectiveness in compressing images.

Uploaded by

shibilbasith4u
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Huffman Coding

The document discusses Huffman coding and run-length coding (RLC) as techniques for image compression. Huffman coding optimally encodes symbols to minimize redundancy, while RLC exploits repetitive pixel values by encoding them as runs. Examples illustrate the application of both methods, highlighting their effectiveness in compressing images.

Uploaded by

shibilbasith4u
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

HUFFMAN CODING AND

RUN- LENGTH CODING


HUFFMAN CODING
• One of the most popular techniques for removing coding
redundancy is due to Huffman.
• When coding the symbols of an information source
individually Huffman coding yields the smallest possible
number of code symbols per source symbol.
• In terms of shannon’s first theorem the resulting code is
optimal for a fixed value of n , subject to the constraint that
the source symbols be coded one at a time.
• The source symbols may be either the intensities of an image
or the output of an intensity mapping operation.
RUN-LENGTH CODING
• Run-length coding(RLC) exploits the repetitive nature of the
image.
• RLC tries to identify the length of the pixel values and
encoded the image in the form of a run.
• Each row of the image is written as a sequence.
• Then length is represented as a run of black and white pixels.
this is known as run-length coding.
• It is very effective way compressing an image.
• If required , further compression can be done using variable
length coding to code the run lengths themselves
• Example : given a sample binary image . apply run length coding
• 00000
• 0 001 1
• 1 1 1 1 1
• 1 1 1 1 1
• Solutions:
• 1)Horizontel RLC
• Run length vectors-(0,5)
• (0,3),(1,2)
• (1,5)
• (1,5)
• No of vectors=6
• Maximum length=5
• 3 bits in binary
• No of bits per pixel=1
• Total no of pixels=6*(3+1)=24
• No of pixels for original image=5*5=25
• Compression ratio=25/24=1.042
• 2)vertical RLC
• Run length vectors-(0,2),(1,3)
• (0,2),(1,3)
• (0,2),(1,3)
• (0,1),(1,4)
• (0,1),(1,4)
• No of vectors=10
• 3 bit binary
• 1 bit per pixels
• Total number of pixels-10*(3+1)=40
• Total no pixels in original image=5*5=25
• Compression ratio=25/40=0.6251
THANK YOU

You might also like