When aggressive data comprssion is applied to image, audio or video, some data may be discarded if its deemed too complex to store at the current data-rate, or if the algorithm decides that the information is of little importance. Compression artifacts occur because of the latent errors in the process or basically the extreme result of overzealous lossy data compression.
Digital Image Compression
Compression artifacts occur in many common media such as DVDs, common computer file formats such as JPEG, MP3, or MPEG files, and Sony's ATRAC compression algorithm. Uncompressed media (such as on Laserdiscs, Audio CDs, and WAV files) or losslessly compressed media (FLAC, PNG, etc.) do not suffer from compression artifacts.
Digital Sound Compression
Compression artifacts in compressed audio typically show up as ringing, pre-echo, drop-outs, warbling, metallic ringing, an underwater feeling, hissing, or "graininess". A good way to observe compression artifacts in audio is to listen to the applause in a relatively highly compressed (eg 96 kbit/sec) MP3. In general, music has repeating structures and more predicable variations in volume, whereas applause is essentially random, therefore hard to compress. This highly compressed track of applause will illustrate the "metallic ringing" and other compression artifacts very well.