Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. T&Cs apply

Binary image compression

How do drug concentrations in our blood affect how we think and feel? In this article, Dr Ming Yan discusses his recent research.

Concept

Images are divided into two categories: color images and gray images. Binary images are special gray images with only black and white gray levels, such as documents, weather maps, engineering drawings, fingerprint cards, handwritten text, maps, newspapers, etc.

The purpose of binary image compression is the same as that of grayscale image coding, which is to reduce the number of bits required to represent the image.

Features

  • In terms of statistical characteristics, since there are only two gray levels, that is, only two source symbols, there are only two corresponding source probabilities, and the sum of these two source probabilities is equal to 1.
  • The amount of image data is small, single pixel can be represented by its gray value (for example, 0 and 255), or binary value (0 and 1), the latter representation method will be easier to store and process the image data.
  • The structure is often relatively simple, and the black and white pixel regions are mostly continuously distributed and clearly divided.

Binary image coding method

Since there are only two gray levels, the amount of data used to represent binary images is inherently much smaller than grayscale and color images of the same size. However, this does not mean that compression is not necessary. Binary images, like other images, also have a lot of compression space.

Different binary images often need different coding methods to achieve the best compression effect. At present, the commonly used binary image coding methods mainly include run-length coding, white block skipping coding, block coding, recognition coding and boundary coding.

Run-length Coding

The basic idea of Run-length Coding (RLC) is to represent the symbol string composed of consecutive source symbols with the same number and the string length. When an image is used as a source, if there are L consecutive pixels with the same gray value G, then only an array (G, L) can be transmitted instead of the gray value of the string of pixels after run-length coding. These consecutive identical pixels are called run-lengths. Obviously, the longer the run-length, the higher the efficiency of run-length coding, so it is especially suitable for binary images with few gray levels and little gray value variation.

Skip white block coding

White skipping block coding is a coding method which takes advantage of the fact that binary images contain a lot of white areas. The encoding method is to divide each line of the image into a number of sub-blocks, each block includes N pixels. If a block is all white, the block is represented by the one-bit word “0”. Otherwise, if a certain block contains at least one black pixel, the block is represented by N+1 bits: the prefix code “1” plus the direct code of the block (“ 0 “for white and” 1 “for black).

Block coding

In block coding, the whole image is divided into equal size sub-blocks, and then codewords of different lengths are assigned according to the probability of different permutations of pixels in each block. Short codewords are assigned with high probability, and long codes are assigned to infrequent ones, so that the average code length is the shortest. Block codes were first used for binary images, such as fax images, and later extended to grayscale images. Because the device is simple, it can be used in real-time processing or transmission systems, and has been paid more and more attention.

Your task

What are the benefits of binary image compression?

Share your thoughts and ideas in the comments below.

© Communication University of China
This article is from the free online

Introduction to Digital Media

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now