<< 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.