0
$\begingroup$

Let I (M x N) be an image made only of 3 pixels, how many unique Huffman code can you make (example: Image I has size 256x256, and has pixels of values 50,100 and 200).

If someone can help me how to solve this problem or give me a hint.

I get it there are 6 unique Huffman codes : 0,10,11 or 1,00,01, is the solution correct?

$\endgroup$
4
  • $\begingroup$ Many more details are required: how many 50, 100 and 200 valued pixels? Are you looking for the encodings employed by jpeg compression? It is possibly better if you study an open source implementation of the jpeg converter because there are many steps separating the image from the Huffman coding. $\endgroup$
    – Chaos
    Aug 29 at 18:14
  • $\begingroup$ This question is from exam and it doesn't have much more details. We done examples like this youtube.com/watch?v=acEaM2W-Mfw . Yes we learned JPEG compression only. $\endgroup$
    – fasdads
    Aug 29 at 18:46
  • $\begingroup$ And the image is 256x256 and contains only values 50,100 and 200 for pixels. $\endgroup$
    – fasdads
    Aug 29 at 18:58
  • $\begingroup$ image made only of 3 pixels If that was rectangular, $M$ was 3 or 1 and $N = 4 - M$. For one possible symbol, I don't even need a function into a one-bit code. For four values, I either get 4 2-bit codes, or the most probable symbol gets a one bit code, and I need a Huffman code for the remaining three. $\endgroup$
    – greybeard
    Aug 29 at 21:55
0
$\begingroup$

If there are only three possible values, all possible Huffman codes have symbol lengths 1, 2, 2. One value has a 1 bit symbol which is 0 or 1, that’s 6 choices. Then we know the two possible 2 but symbols; one of the remaining two values uses one code, and the other value uses the other. 2 more choices, so a total of 12 choices.

$\endgroup$
2
  • $\begingroup$ I get it there are 6 unique Huffman codes : 0,10,11 or 1,00,01. I don't understand what you mean by 12 ? $\endgroup$
    – fasdads
    Aug 31 at 10:39
  • $\begingroup$ You are talking about symbols. Huffman codes are for example (50 -> 0, 100 -> 10, 200 -> 11) or (50 -> 0, 100 -> 11, 200 -> 10) or (50 -> 1, 100 -> 00, 200 -> 01) etc. $\endgroup$
    – gnasher729
    Aug 31 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.