Skip to main content

UNIT 5: DATA COMPRESSION

 

Introduction to Data Compression

Data Compression is the process of encoding information using fewer bits.
It aims to reduce the size of the data while maintaining the necessary quality or information.

  • Applications: Image, video, and audio compression (JPEG, MP3, video codecs).

  • Goal: Reduce storage space and speed up transmission without losing essential information.


2. Data Compression vs Bandwidth

Bandwidth refers to the data transmission capacity of a communication system (how much data can be transmitted per unit of time).
Data Compression is a technique to reduce the size of data, leading to reduced transmission time, which increases effective bandwidth.

Relation:

  • Compressed data requires less bandwidth for transmission.

  • Compression reduces storage and transmission costs, improving efficiency.

Example:

  • A 1MB image compressed to 100KB requires less bandwidth for transmission and storage.


3. Pixel Coding

Pixel Coding involves representing pixel values using fewer bits, exploiting redundancy in image data.

Common Techniques:

  • Run-Length Encoding (RLE): Compresses consecutive pixels with the same value.

  • Huffman Coding: Uses variable-length codes based on pixel frequency.

  • Arithmetic Coding: Encodes entire image as a single number based on probability.

Example:

  • A simple black-and-white image could have consecutive pixels (e.g., 0000), which can be represented more efficiently by coding it as "4 zeros".


4. Predictive Coding

Predictive Coding predicts the next pixel value based on the neighboring pixels and encodes the difference (error) between the predicted and actual value. This method capitalizes on the fact that neighboring pixel values are often highly correlated.

Steps:

  • Predict pixel value (using neighboring pixels).

  • Compute the error (difference) between the predicted and actual value.

  • Encode the error using fewer bits.

Advantages:

  • Reduces the amount of data needed to represent each pixel.

  • Works well for images with large regions of similar color or intensity.

Example:

  • Predicting the pixel value of an image based on the previous row or column, and encoding only the difference.


5. Transform Coding

Transform Coding is used to represent an image in a different basis or domain (like frequency domain) to exploit redundancies for compression. This involves transforming the image data, quantizing the transformed data, and then encoding it.

Popular Transform Coding Techniques:

  • Discrete Cosine Transform (DCT): Used in JPEG compression.

  • Wavelet Transform: Used in JPEG2000 for better compression.

Steps:

  1. Apply a transform (like DCT or Wavelet) to the image.

  2. Quantize the transformed coefficients.

  3. Encode the quantized coefficients using techniques like Huffman coding or arithmetic coding.

Advantages:

  • Reduces the correlation between pixels.

  • Better compression compared to pixel-based coding.


6. Coding of Two-Tone Images

Two-tone images are binary images, where each pixel can be either black or white (0 or 1).

Compression Methods for Two-Tone Images:

  • Run-Length Encoding (RLE): Highly effective for two-tone images. It compresses consecutive runs of identical pixels (e.g., long horizontal or vertical white or black lines).

  • Huffman Coding: For representing the pixel values efficiently based on frequency of occurrence.

Example:

  • In a binary image with large white regions, RLE can encode a series of white pixels as a single count rather than storing every pixel individually.


7. Summary of Compression Techniques

TechniqueDescription
Pixel CodingEncoding individual pixel values more efficiently (e.g., RLE, Huffman).
Predictive CodingPredicting pixel values and encoding the error (difference).
Transform CodingApplying transformations (e.g., DCT, Wavelet) to remove redundancies.
Two-Tone Image CodingSpecialized methods for binary images (e.g., RLE).

8. Advantages of Data Compression:

  • Storage: Saves disk space by reducing file size.

  • Transmission: Speeds up data transmission over networks by reducing the amount of data to be sent.

  • Cost Efficiency: Lower storage and transmission costs.

  • Quality Preservation: Methods like lossless compression preserve original data quality, while lossy techniques provide high compression with some loss in quality.


In Short:

  • Data Compression reduces the size of data while maintaining essential information.

  • Pixel Coding, Predictive Coding, and Transform Coding are some methods used to achieve image compression.

  • Two-tone images can be compressed efficiently using techniques like Run-Length Encoding.

Comments

Popular posts from this blog

Raster scan Vs Vector Scan

1. Raster Scan Display   How It Works : A raster scan display works by painting an image on the screen pixel by pixel, row by row. It follows a systematic pattern where the electron beam (in CRT monitors) or the display elements (in modern LCD/LED screens) sweep across the screen from left to right, top to bottom, in a series of horizontal lines (scan lines). This process is akin to how a traditional TV screen works.   Process : The display draws the image starting from the top-left corner, moving to the right, then moves to the next row below, and repeats this process until the entire screen is filled. This pattern creates a grid of pixels, where each pixel can have a color and brightness level.   Characteristics : Pixel-based : The screen consists of a grid of pixels, and each pixel can have a distinct color and intensity. Continuous Image : Raster scan displays are capable of displaying detailed and complex images, including photographs and videos, because they break t...

Inheritance

*■ Inheritance*  • Inheritance is a concept in OOP that allows a class to inherit properties and behaviors (methods) from another class. • A class that inherits from another class is called a derived class (or subclass) • The class which gets inherited by another class is called the base class (or superclass). • Inheritance is possible only if there is is-a relationship between parent and child class. • constructors are not inherited in derived class, however the derived class can call default constructor implicitly and if there's a parameterised constructors in bass class then derived class can call it using 'base' keyword.  ____________________________________________  *➤ Rules of Inheritance*  1) C# supports single inheritance, meaning a class can inherit from only one base class. 2) A parent class constructor must be accessible in child class otherwise  inheritance will be not possible. 3) every class, whether user-defined or predefined implicitly derives fr...

unit -1 Introduction of Image processing

  What is Image Processing? Image processing is a method to perform operations on an image to enhance it or extract useful information. It is a type of signal processing where the input is an image, and the output may be either an image or characteristics/features associated with that image. Goals of Image Processing Image Enhancement : Improving visual appearance (e.g., contrast, sharpness) Image Restoration : Removing noise or distortion Image Compression : Reducing the amount of data required to represent an image Feature Extraction : Identifying objects, edges, or patterns Image Analysis : Understanding and interpreting image content Object Recognition : Detecting and identifying objects in an image What is an Image? An image is a two-dimensional function f(x, y) , where x and y are spatial coordinates, and f is the intensity (brightness or color) at that point. For digital images, both x, y, and f are finite and discrete. Types of Image Representation...