java - Compressing a given image n times using huffman coding technique -
i writing program in java in takes input user how many times given image needs compressed, based on should compress image.
initially convert image pixel matrix, find probabilities of each pixel appearing in matrix , apply huffman code obtain code in form of 0's n 1's.
now if try compress 2nd time have 2 probabilities i.e of 0 n 1.hence cant apply huffman code now.
so can done in situation?
you apply arithmetic code on 2 symbols. if, example, there many more zeros ones arithmetic code reduce total number of bits encoding zeros each less 1 bit, , ones more 1 bit. (this done considering output bits binary fraction, , each new input bit reducing range of binary fraction.)
however find after compressing using huffman codes, have close same number of ones zeros. not compressible way. or way.
Comments
Post a Comment