Introduction
Signal compression is the process where the redundant information in a signal is identified and deleted. Signal compression is quite an important technology in digital communication. Speech, audio, image, and digital video are all major disciplines of signal compression, and many compression algorithms have been implemented, but we will only highlight image compression in this blog.
Image compression is an application of signal compression that encodes the original image with a few bits. The objective of image compression is to reduce the redundancy of the image and to store or transmit data in an efficient form.
Why is Signal Compression Required?
Compression has several advantages, including reduced storage hardware, data transfer time, and communication bandwidth. This has the potential to save a lot of money. Compressed files require far less storage space than uncompressed ones, resulting in significant savings in storage costs.
Image compression is beneficial because it reduces the amount of memory needed to keep digital images or send them over a network such as the internet. The reduction in file size allows more images to be stored in a given amount of disk or memory space. It also reduces the time required for images to be sent over the Internet or downloaded from Web pages.
Example
Consider a black-and-white image with a resolution of 1000*1000 pixels and an intensity of 8 bits per pixel. As a result, the total number of bits required per image is 1000*1000*8 = 80,00,000 bits. Consider the total bits for a video of 3 seconds with 30 frames per second of the above-mentioned kind images: 3*(30*(8, 000, 000))=720, 000, 000 bits.
As we can see, just storing a 3-second video requires a large number of bits. As a result, we need a technique to have a suitable representation as well as a way to retain image information in a small number of bits without compromising the image's character. As a result, image compression is crucial.
Types of signal Compression
Signal compression is the use of various techniques to increase the quality or quantity of signal parameters transmitted through a given telecommunications channel.
Types of signal compression include:- Bandwidth compression - Bandwidth compression implies a reduction in normal bandwidth of an information-carrying signal without reducing the information content of the signal.
- Data compression - data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation
- Dynamic range compression - Dynamic range compression (DRC) or simply compression is an audio signal processing operation that reduces the volume of loud sounds or amplifies quiet sounds, thus reducing or compressing an audio signal's dynamic range.
- Gain compression - Gain compression is a reduction in differential or slope gain caused by nonlinearity of the transfer function of the amplifying device
- One-way compression function : one-way compression function is a function that transforms two fixed-length inputs into a fixed-length output. The transformation is "one-way", meaning that it is difficult given a particular output to compute inputs which compress to that output.
- Image compression - Image compression addresses the problem of reducing the amount of data required to represent a digital image.
Here in this article we will look in detail about image compression, its techniques and implementation. Steps involved in compressing image:
Image Compression techniques
The image compression techniques are broadly classified into two categories depending whether or not an exact replica of the original image could be reconstructed using the compressed image.
These are:
- Lossless Technique
- Lossy Technique
Lossy Compression
In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size for storing, handling, and transmitting content. This is opposed to lossless data compression (reversible data compression) which does not degrade the data. The amount of data reduction possible using lossy compression is much higher than using lossless techniques.
Lossy compression algorithms are techniques that reduce file size by discarding the less important information. Computers can capture an incredible amount of detail in a photo—but how much of that detail can humans actually perceive? As it turns out, there's a lot of detail that we can remove. Lossy compression algorithms are all about figuring out clever ways to remove detail without humans noticing
Example :
Lets considered a photo of a cat :
Lossless compression
Lossless Compression is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data. Lossless compression methods are reversible. Lossless compression is used in cases where it is important that the original and the decompressed data be identical, or where deviations from the original data would be unfavorable.
Examples of lossless compression include GZIP, Brotli, WebP, and PNG. Text compression is an important area for lossless compression.
When should you use lossy and lossless compression?
Lossy compression data is good for base map imagery because it has faster loading speeds with lower compression ratios. You should not choose lossy compression if you want to perform further analysis of the data.
Lossless compression is good if there will be a new analysis of the data. This is because it doesn’t alter any of the original values. This means that it’s good for discrete data or any raster image that already has lossy compression.
Implementation of Image Compression in MATLAB using FFT
Code:
Step 1: Reading the image file
a=imread('random.jpg');
Step 2: Gray scaling the image for better illustration and storing the image size in variables row and col
grayIm =rgb2gray(a);
[row col] = size(grayIm);
Step 3: Display the original grayscale image
imshow(grayIm);
title('original image')
Step 4: Finding FFT of the grayscale of the given image
A=fft2(grayIm); %2D fft
Step 5: zero out all small coefficients and inverse transform
count_pic=2;
Btsort = sort(abs(A(:)));
for keep=[.99 .05 .01 .002];
thresh = Btsort(floor((1-keep)*length(Btsort)));
ind=abs(A)>thresh; %finding small indices
count=row*col-sum(sum(ind));
Alow=A.*ind; %threshold small indices
per=100-count/(row*col)*100;
Blow=uint8(ifft2(Alow)); %compressed image
figure;
imshow(Blow); %reconstructed image
count_pic=count_pic+1;
title([num2str(per) '% of fft basis'])
end
Output
In this we can see that when the image is compressed to 99% it has very minor changes while the image which is compressed to 0.2% is slightly distorted.
Comments
Post a Comment