I started with the easy stuff, run-length encoding for text, lossy vs lossless for images, but then kind of trailed off when trying to connect them.
Start by defining compression and its two main types: lossless and lossy. Then explain how each applies to text and images, highlighting key algorithms and trade-offs. Conclude with a comparison of similarities and differences, focusing on data characteristics and use cases.
Pro tip: Emphasize that text compression is typically lossless due to exactness requirements, while image compression often leverages human perception for lossy methods. Mention real-world examples like JPEG and ZIP to show practical understanding.
Explain that compression reduces data size by encoding information more efficiently. Distinguish between lossless (exact reconstruction) and lossy (approximate reconstruction) compression.
Describe common lossless algorithms like Huffman coding, LZ77/LZ78 (used in ZIP, gzip), and Burrows-Wheeler transform. Note that text compression must be lossless to preserve exact meaning.
Cover lossless formats (PNG, GIF) using techniques like DEFLATE, and lossy formats (JPEG, WebP) using DCT, quantization, and chroma subsampling. Highlight perceptual models.
Similarities: both exploit redundancy, use entropy coding, and involve trade-offs between size and quality/speed. Differences: text is discrete and requires lossless; images are continuous and can tolerate lossy compression due to human perception.
Mention when to use each: lossless for text, medical images; lossy for web images, streaming. Consider factors like compression ratio, speed, and quality.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.