data-compression
data-compression
Data Compression
Purpose of Compression
• Save storage space on devices.
• Reduce time for streaming or transferring files over networks.
• Minimize upload/download times, conserving bandwidth.
• Lower storage costs, especially with cloud services.
• ISPs may charge based on data usage, so compressed files save on data
costs.
Lossy and Lossless File Compression
Types of Compression:
• Lossless Compression: No data is lost; the original file can be perfectly
reconstructed. Used when every detail needs to be preserved.
• Lossy Compression: Some data is discarded to reduce file size. Cannot
fully reconstruct the original file but is useful for reducing storage and
bandwidth.
Lossy Compression
• Removes less important data:
• Image files: Lowers resolution or color depth.
• Sound files: Reduces sampling rate or resolution.
Note:
1. RLE is effective for Repeated Data: Works best with files that have long runs of
repeated elements.
2. RLE may not reduce file size if there are frequent changes in data (e.g.,
alternating patterns).
3.Commonly used in image and text compression where patterns are prevalent.