• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How does image compression work?

well, basically, instead of saying black, black, black, black, black...

you can just say then next 100 pixels are black and save a lot of space. Obviously thats pretty simplified 🙂
 
It really depends on the type of compression you're talking about.

Lossless image compression is the method described above by shalmanese

Lossy image compression is the same except some data is thrown away. There is a loss in quality(most times it is not noticeable) so that the file sizes can be smaller.
 


<< well, basically, instead of saying black, black, black, black, black...

you can just say then next 100 pixels are black and save a lot of space. Obviously thats pretty simplified 🙂
>>


PCXs and GIFs do this. you dont see PCXs around much any more though. its called run-length encoding. it works very well for stuff like logos or simple graphics. It usually works very very poorly for photos. JPGs are "lossy" - there is a quality loss, but if you do it right, the image still comes out looking good. I don't know how exactly JPGs do their magic.
 
The best place for information is almost always the consortium or body created to oversee the standard, e.g. the JPEG consortium page. From there, there's a bunch of links to FAQs, source code, and who shot JFK.

Well, maybe not the last part but section [74] of this compression FAQ gives a really brief overview of what's involved with compression in JPEG. That FAQ series also contains some info about other compression schemes.
 
Just to add to what's already been said, there are two main types of lossy compression. One, like JPEG and MPEG-1/2, is based on something called the Inverse Cosine transform. Cosine transforms break an image down into small blocks (e.g. 5x5 pixels), and basically creates a concise mapping of the color and shapes contained in that block (and, in the case of motion, stores the intermediate changes between reference frames). The small blocks are apparent when there is noise in the signal of a picture or video signal - it gets blocky and multicolored. The other, which JPEG-2000 and MPEG-4 use, is Wavelet transforms. A wavelet is a complex function that basically mimics the type of shapes and colors through a mapping. Different wavelets are better at compressing different types of video and audio.
 
Back
Top