Image Compression you can implement in a day

I need to implement a decent image compression algorithm in a day or two, without using libraries.
So it can't be anything with multiple layers, like jpeg.
I was thinking huffman encoding,

Which would be a good algorithm I can learn to implement in a day or two that is not terrible at it's job.
 
15,171
4,824
I need to implement a decent image compression algorithm in a day or two, without using libraries.
So it can't be anything with multiple layers, like jpeg.
I was thinking huffman encoding,

Which would be a good algorithm I can learn to implement in a day or two that is not terrible at it's [SIC] job.
You can find good examples on the internet of huffman encrypt/decrypt. I remember years ago lifting one and modifying it to my needs in a couple of hours.
 
1,888
192
.
You can find good examples on the internet of huffman encrypt/decrypt. I remember years ago lifting one and modifying it to my needs in a couple of hours.
Another idea is to compute the difference between a pixel value and the pixel value to the left or above it, and use huffman compression on those differences. (you can just use unsigned values,)
 
555
85
you could also look into LZW compression, here is the original paper of Welch:
 

Tom.G

Science Advisor
2,665
1,489
1) The simplest of course in just Run Length encoding. That takes advantage of correlations along scan lines.

2) The next step up is correlation between succesive scan lines (copy the pixel above) combined with Run Length.

3) One more step up is copy 2) above that is <offset or different length> by X pixels.

Number 3 above is used in FAX machines. The specific codes for the above are described in the FAX standard. I worked on the early prototypes several decades ago and don't recall the details. This Google search returns many results and probably has the actual standard listed.

The hardware implementation required a one-scanline buffer for the look-behind, some logic, and 3 or 4 EEprom memories for the table lookup/encode-decode.

Cheers,
Tom
 

Want to reply to this thread?

"Image Compression you can implement in a day" You must log in or register to reply here.

Related Threads for: Image Compression you can implement in a day

Replies
0
Views
2K
Replies
4
Views
4K
Replies
4
Views
2K
Replies
7
Views
2K
  • Posted
Replies
21
Views
4K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top