K - means clustering

Practice Lab - K - means clustering

How does k-means clustering help in image compression. What exactly happens in the hood? Can anyone please explain me the process.

It allows each pixel to be represented by a 4-bit value (an index into a map of 16 colors), instead of the original 24 bits (8 bits for each of Red, Green, and Blue).