Abstract
Image compression is a process that reduces memory space required to store an image. The image compression techniques are broadly classified into two categories a) Lossless technique b) Lossy technique. Lossy compression technique achieves higher result, but due to data loss it may cause spatial inconsistency, blocking artifact, quantization noise in the decompressed image degrading the image quality. Most of the existing compression techniques are applicable on single image separately. In this study an image compression method is proposed where multiple images of the same size are combined together and compressed to achieve higher compression ratio while keeping image quality as close as standard image compression techniques. Luminance channel of each image is compressed separately using Vector Quantization (VQ) algorithm while two chrominance channels, Cb and Cr of all images are combined into a three dimensional matrix that forms training vector. Clustering is applied on the training vector to get the initial color representatives. Thus, for the chrominance channels of n number of images, the proposed method generates one index matrix and one centroid matrix of size 256×2× n where 256 is the number of clusters. This centroid matrix contains one 256×2 dimensional centroid matrix for each individual image. This 256×2 matrix contains centroid of each cluster. The centroids of each and every cluster of an image are updated individually using optimization technique to get a better centroid (Cb, Cr) pair. This process updates the color representative pair of Cb and Cr further. This method has been applied on standard images in literature and images collected from UCID v. 2 color image database. Experimental results are analyzed in terms of PSNR and space reduction. Experimental results show that the proposed method achieves a higher compression ratio retaining almost similar image information as other standard lossy compression algorithm.
Keywords
Introduction
Image compression reduces the space required to store a digital image in storage media keeping resolution and visual quality of the reconstructed image as close as possible to the original image [1–14]. Image compression techniques reduce the number of bits required to represent an image by taking advantage of the three basic data redundancies- a) Coding redundancy, b) Inter pixel redundancy and c) Psychovisual redundancy [13, 16]. Generally two types of image compression techniques are found in the literature-1) Lossless technique and 2) Lossy technique. In lossless compression [2–4] technique, the amount of space reduction is less compared to the lossy techniques. Run length, Arithmetic coding, PiCture eXchange(PCX) [6] etc are some well-known lossless compression techniques. Lossy compression techniques give a high degree of compression, but due to data loss spatial inconsistency, blocking artifact, quantization noise may arise in the decompressed image. Vector Quantization [7–13], JPEG [27–31], GIF, Color Image Quantization [17–24] are examples of lossy compression technique. Most of these image compression algorithms are applied on an individual image separately.
Vector Quantization (VQ) [7–13] algorithm is an example of lossy image compression [4] technique. VQ is a very effective compression algorithm with high compression ratio. But blocking artifacts [28, 29] appear in the decompressed image. Sometime blocking artifacts become explicit in the decompressed image and the visual appeal of the decompressed image is affected seriously. In the literature, many attempts have been made to reduce the compression time for better codebook generations of VQ. S.D Thepade et al. [10] proposed a clustering algorithm for Vector Quantization using slant transform in 2013. D. K. Mahapatra and U. R. Jena [11] also proposed partitioned K-Means clustering based on hybrid DCT-Vector Quantization for image compression in 2013. In 2016, C. Karri [12] proposed a method for fast vector quantization using a Bat algorithm. In 2017, A. Hasnat et al. [13] proposed modified Vector Quantization method applicable on de-correlated color space where luminance channel is compressed using a different approach to further improve quality of the decompressed image.
Color Image Quantization (CIQ) [15–24] is a lossy image compression technique [4] that decreases the number of color palette as low as possible in an image by maintaining the less amount of distortion so that the visual appeal of the regenerated image is very near to the original image. Color quantization is used in many image processing fields like compression, segmentation, texture analysis, watermarking, non-photorealistic rendering, detection, content-based retrieval etc. Designing optimal color pallet/code to retain crucial color information of the image is a major challenge in CIQ as data loss occurs in the process. Evolutionary algorithms such as PSO [22, 25], GA [25, 26] are applied to CIQ [15–24] to further improve the color pallet. Freisleben and Schrader [15] proposed a quantization method by combining the evolutionary algorithm (EA) [23, 25] and a standard search strategy. Obtaining higher compression ratio is a major objective of CIQ [15–24] while satisfying many criteria- i.e. minimization of information loss, less distortion, less complexity of algorithm etc.
JPEG [27–31] is a lossy image compression technique and it stands for the Joint Photographic Experts Group. JPEG was designed specifically to discard information those human eyes cannot recognize. It works on frequency domain. JPEG also suffers from blocking artifact. In 2007 B. Oztana et al. [30] proposed a method to reduce blocking artifact from a JPEG compressed image where artifacts arise on block sides. In 2014 Jonathan Quijas [29] proposed a post processing technique to remove blocking artifact from a JPEG compressed image. In 2016 Zhangyang Wang et al. [31] proposed a method for fast restoration of JPEG compressed images which are mainly post processing technique to remove blocking artifact. In 2017, Jae Woong Soh et al. [32] proposed an image compression method based on Karhunen Lo‘eve Transform (KLT). This method is same as JPEG but instead of DCT, Image Adaptive Transform (IAT) approach (derived from the KLT) is used. They claimed that the method performs better than JPEG as IAT shows better result in the high bit region of the image. The method shows better performance for very high resolution images like 4K images only [31].
JPEG2000 [33] is an image compression standard developed in the year of 2000 by the Joint Photographic Experts Group (JPEG), part of the International Organization for Standardization (ISO). JPEG2000 uses Discrete Wavelet Transform (DWT) which gives high compression ratio and good quality of image than JPEG. JPEG2000 has significant advantage over JPEG where blocking artifacts are less visible but it requires more computational power to process. In 2015 M. M. Rahman et al. [33] proposed a technique to improve the JPEG2000 compression method by adding adaptive threshold. But in this technique coding algorithm is much more complex and computational needs are much higher.
Most of the compression algorithm compresses an image separately or individually. VQ, JPEG and JPEG2000 suffer from blocking artifact problem. These algorithms have an upper bound of space reduction also. Whereas CIQ achieves higher PSNR but the compression ratio is not comparable to VQ, JPEG or JPEG2000. This study proposes a multi-image compression method exploiting features of Vector Quantization [7–13] and Color Image Quantization [15–24] to achieve higher compression ratio. Proposed method works on de-correlated color space i.e. YcbCr [13], YUV, CIELAB [35]. This method compresses multiple images of the same size together. The luminance channels of all images are compressed separately using Vector Quantization algorithm. The other two chrominance channels Cb and Cr of each image first combined into a three dimensional matrix. The K-Means clustering algorithm is applied to generate one centroid matrix and one index matrix for the chrominance channels of all images (taken together). This step helps to achieve higher compression ratio. The centroid of each and every cluster of an image is updated individually using optimization technique again to get a better centroid (Cb, Cr) pair.
This proposed image compression method has been applied on several images collected from standard images available in literature and images from UCID v.2 [34] database.
The article is organized as- In section 2 brief discussion is given on existing methods- vector quantization, color image quantization and JPEG. Section 3 discusses proposed method. Section 4 gives an experimental result and its analysis. Section 5 concludes the article.
Related works
This section briefly discusses standard lossy image compression techniques below.
Vector quantization
Vector Quantization [7–13] is a simple and lossy compression technique that achieves very high compression ratio. The steps of the algorithm are discussed below.
So the code vector and the index array are stored as compressed image. During the decompression procedure, a sub image of p × p is formed using the code vector indicated by the index array. Thus combining all the sub-image the decompressed image is constructed.
One important objective is to minimize the distortion between original image and reconstructed image during codebook generation process. Linde-Buzo-Gary (LBG) [13] algorithm is widely used in VQ for code vector generation.
A training vector, x m = (xi,1, xi,2, xi,3, … …, xi,k) is a k dimensional matrix where m = 1, 2, 3, … ….., M. Let N is the number of code vector in the codebook and a code vector c i = {ci,1, ci,2, ….. ci,k}; where i = 1, 2, 3 … …, N. Let T = (x1, x2, x3, …., x k ) be a training vector.
Let S
n
be the encoding region associated with the code vector c
n
. Let S = {S1, S2, S3, ….., S
N
} denotes the partition of the space if the source vector x
m
in the encoding region S
n
then approximation (Q (x
m
)) is c
n
given by Equation 1.
If C and S are a solution to the above minimization problem, then it must satisfy the following two criteria.
Nearest neighbor condition
This condition says that the encoding region S n should consist of all vectors these are closer to c n than any of the other code vectors.
Centroid condition
This condition says that the code vector cn should be average of all those training vectors which are in encoding region Sn.
Vector Quantization [7–13] uses block shaped vectors which cause blocks at vector boundaries. The standard VQ algorithm produces blocking artifacts in the decompressed image. Larger code vector size degrades quality of image but, required space to store the image decreases. If code vector size decreases, then space requirement increases but image quality improves. Therefore VQ [7–13] not only produces perceptually distracting blocking artifacts, but there is limit of reduction of space requirement.
Color quantization [15–24] is a lossy image compression technique [4]. Color quantization works in two steps a) pallet design- selection of suitable number of colors generally 8 to 256 and b) pixel mapping- replaces each pixel color with the color in the pallet. CIQ can be formally defined as follows.
Given a set of NS′ color where S′ ⊂ R N d and N d is the dimension of data space. The color quantization is mapped f q : S′ → S″ where S″ is a set of NS″ colors such that S″ ⊂ S′and NS″ < NS′. The objective is to minimize quantization error resulting from replacing a color c ⊂ S′ with its quantized value f q (c) ∈ S″ [18, 24].
The steps of CIQ algorithm are shown below.
Joint photographic experts group (JPEG)
JPEG [27–31] stands for Joint Photographic Experts Group. It is a lossy image compression algorithm works in frequency domain. JPEG is designed specifically to discard information those human eyes cannot easily recognize. The steps of JPEG algorithm are shown below.
JPEG compression is typically measured as a percentage of the quality level. Quality factor (QF) plays very important role. The QF is a number that determines the degree of loss in the compression process. For a JPEG compression image with 100% quality factor has almost no data loss whereas with 1% quality data loss is huge and visual quality of the image is drastically affected. The steps of JPEG are discussed below.
JPEG 2000
JPEG2000 [33] is an International standard compression technology developed by the Joint Photographic Experts Group (JPEG), part of the International Organization for Standardization (ISO). It is a compression standard enabling both lossless and lossy storage. This technique improves the quality and compression ratios, but also requires more computational [33].
JPEG2000 is a wavelet based compression technology. It has many benefits over the JPEG format.
The steps of JPEG2000 are discussed below.
These decomposition levels are made up of sub bands of coefficients that describe the frequency characteristics of local areas (rather than across the entire tile-component) of the tile component.
Proposed method
This section proposes an image compression technique where multiple images of the same size are combined together and compressed to achieve better compression ratio. It works on de-correlated color model like YcbCr [13], YIQ, Lαβ. In YCbCr color model luminance(Y) channel represents image information and two chrominance channels (Cb and Cr) carry only color information. As luminance channel carries vital image information, so the luminance channel is compressed separately using Vector Quantization algorithm to retain maximum image information. Two chrominance channels Cb and Cr are combined into a three dimensional matrix where × plane denotes number of chrominance channel of an image, y plane represents the number of pixels in an image and z plane represents number of images taken together for compression.Then clustering algorithm is applied on this three dimensional matrix and generates one index matrix and one code vector. In this work, K-Means clustering algorithm is applied. Thus for n × 2 number of chrominance channel of n images only one index matrix and one code vector are generated. The steps of the proposed method are explained below.
Compression process

A two dimensional matrix where Cb and Cr color values of an image are arranged in 1st and 2nd column respectively.

Three dimensional matrix(training data) formation: X plane represents Cb and Cr channels, Y plane denotes number of pixels of an image and Z plane represents number of images are considered for compression.

A sample three dimensional matrix of four standard images Girl, Couple, Jelly beans and Girl in red shirt each of size 256x256 with actual Cb and Cr values.
Figure 3 shows a sample three dimensional matrix containing Cb and Cr values of four standard same size “Girl”, “Couple”, “Jelly Beans” and “Girl in red shirt” images. The size of each image is 256 × 256. In first two dimensional matrix Cb and Cr values of “Girl” image are stored in 1st and 2nd column respectively. In a similar way chrominance(Cb and Cr) values of “Couple”, “Jeally Beans” and “Girl in red shirt” images are stored in second, third and fourth matrices respectively.

A single training vector: Cb11 and Cr11 stands for Cb and Cr values of 1st pixel of first image.

Flowchart of the proposed multi-image compression technique.
Flowchart of the proposed method shown in Fig. 5.
Thus for two chrominance channels of n number of images, only one cluster index matrix and one code vector matrix are generated and required space to store n × 2 number of chrominance channels are decreased reasonably in this step.

Centroid update process using Particle Swarm Optimization.
The same process is repeated to update code vector of all the images in the group. In this way three dimensional code vectors are updated second time. This step helps to retain better colour information.
PSNR of compressed “Girl” image before and after updating code vector using PSO and is shown in Table 1.
It can be seen from the Table 1, The updated code vector using PSO results in better PSNR. This updated 3 dimensional code vectors are finally stored.
Effect of centroid update using pso on girl image

Flowchart of the proposed decompression algorithm.
The decompression process is a reverse process of compression. The steps are shown below.
Luminance channel of each image is retrieved using code vector and index matrix of the respective image.

a) Original Image, decompressed images using b) Vector Quantization c) Color Image Quantization d) JPEG e) JPEG2000 f) Proposed Method(Cluster size cosidered for VQ and proposed method is 256, for CIQ it is 128. In case of JPEG algorithn, Quality Factor is set to 50 and 60 for “Girl”and Jelly Beans”, images respectively whereas in case of JPEG2000, Quality Factor is set to 30 and 40 respectively to keep image quality almost same as proposed method in terms of PSNR) **Here space requirments of proposed method for output images is much lesser than the VQ, CIQ, JPEG and JPEG2000 algorithms).
In decompressed image blocking artifacts may arise. The method proposed by B. Oztana et al. [30] in 2007 is applied to reduce these artifacts. Blocking artifacts appear at the edge area of the compressed image. These artifacts are reduced using the following steps.
i. Tag all pixels in luminance channel as edge/non-edge.
ii. Identify the region that belongs to q × q tile boundary. If the edge is not tagged then every pixel in boundary region and its next region are replaced by average value of previous and next pixel. If the edge is not found, every pixel belongs to row number multiple of q and q + 1 is replaced by the average pixel value of (q - 1) th and (q + 1) th row.
iii. Similarly the column number multiple of q and q + 1 are replaced by the average pixel value of (q - 1) th and (q + 1) th column.
By index matrix and code vector matrix chrominance channels (Cb, Cr) each image are retrieved.
Respective luminance and two chrominance (Cb, Cr) channels are combined together to reconstruct images. Decompression process is shown in Fig. 7.
The proposed method is implemented using MATLAB2017 and tested on standard images in the literature and color images of UCID.V2 [34] database. Using several YCbCr images multiple groups are formed where each group contains three to six number images of the same size. Amount of space reduction depends on the number of images in the group. More number of images increases space reduction, but image quality is degraded further.
Figures 8(a) to 8(f) show the original image, decompressed image using Vector Quantization, Color Image Quantization, JPEG, JPEG2000 and proposed method respectively.
The image quality of “Girl” and “Jelly Beans” decompressed images shown in Fig. 8(d) using JPEG, in Fig. 8(e) using JPEG2000 and decompressed images shown in Fig. 8(f) using proposed method almost same in terms of PSNR. But space reduction using JPEG are 82.74%, 78.96% respectively. The space reduction using JPEG2000 are 86.64%, 83.31% respectively whereas space reduction using proposed method are 93.09%, 93.49% respectively. Therefore storage space requirement using proposed method is less than the existing methods.
Space reduction using VQ, CIP, JPEG, JPEG2000 and proposed method (taking six images at once) with 256 clusters
Space reduction using VQ, CIP, JPEG, JPEG2000 and proposed method (taking six images at once) with 256 clusters
PSNR between original and decompressed image using VQ, CIQ, JPEG, JPEG2000 and proposed method (taking six images together), with 256 number of clusters
The performance of the image compression method is analyzed using two parameters- required memory space reduction and quality of the decompressed image. PSNR [10, 11] is used to measure the quality of reconstructed image using lossy compression [4]. While comparing compression algorithms, a higher PSNR generally indicates that the reconstruction is of higher quality. Peak signal-to-noise ratio (PSNR) is computed between Y, Cb and Cr channels of the original color image and decompressed image separately. When comparing the quality of the decompressed image, a higher PSNR generally indicates better compression algorithm. PSNR is defined by Mean Squared Error (MSE) [22] using Equation 5.
Where Mean Squared Error (MSE) [22] is defined using Equation 6.
where I, Ic represent the matrix data of the original image and the decompressed image respectively. m, n represent number of rows and number of columns respectively in the images. MAXf is the maximum signal value that exists in the original image. The memory space reduction percentage is calculated using Equation 7.
where S=space required to store the uncompressed image, S c =space requirement to store the compressed images.
Space reduction using VQ, CIQ, JPEG, JPEG2000 and proposed method (five images at once) with 256 clusters
PSNR between original and decompressed image using VQ, CIQ, JPEG, JPEG2000 and proposed method (taking five images at once), with 256 number of clusters
In case of JPEG, required space is calculated by maintaining PSNR value for each individual image almost same as proposed method by adjusting quality factor (QF) accordingly.
Space reduction using VQ, CIQ, JPEG, JPEG2000 and proposed method (taking four images at once) with 128 clusters
PSNR between original and decompressed image using VQ, CIQ, JPEG, JPEG2000 and proposed method (taking four images at once), with 128 number of clusters
PSNR between jpeg and proposed method by mainaining required space almost same for both the methods

a) Original image, b) Decompressed image using JPEG c) Decompressed image using JPEG2000 d) Decompressed image using KLT based compression method e) Decompressed image using proposed method.
PSNR between jpeg2000, karhunen loeve transform(klt) based compression and proposed method by mainaining required space almost same for all the methods

Average percentage of space reduction using VQ, CIQ, JPEG, JPEG2000 and proposed method (taking 6, 5, 4,3 images).
Table 3 shows the computed PSNR between the original image and the decompressed image using VQ, CIQ, JPEG, JPEG2000 and the proposed method. Here the proposed method takes six images at once for compression. It is observed from experimental result shown in Table 3 that PSNR values of images using proposed method are almost similar to that of VQ, CIQ, JPEG, JPEG2000 but proposed method achieves better compression ratio.
Table 4 shows the percentage of reduction of required space to store the compressed image using VQ, CIQ, JPEG and JPEG2000 and proposed method, taking five images (taking image number 1 to 5, 2 to 6, 7 to 11, 8 to 12, 13 to 17 and 14 to 18) at once with 256 number of clusters.
From Table 4, it is evident that the space reduction of images using proposed method lies in the range 92.84% to 96.14% which is higher than space reduction of VQ (88.47% to 94.18%), CIQ (75.69% to 85.00%), JPEG (66.88% to 85.77%) and JPEG2000 (79.98% to 89.99%). Therefore, the proposed method again outperforms VQ, CIQ, JPEG and JPEG2000 in terms of space reduction.
Table 5 shows the computed PSNR between the original image and decompressed image using the VQ, CIQ, JPEG, JPEG2000 and proposed method. Here the proposed method takes five images at once for compression. The result in Table 5 shows that PSNR using proposed method are almost similar to the VQ, CIQ, JPEG and JPEG2000 method.
Table 6 shows the percentage of space reduction using VQ, CIQ, JPEG, JPEG2000 and proposed method, taking four images (by grouping image number 1 to 4, 3 to 6 then image number 7 to 10, 9 to 12 last 13 to 16,15 to 18) at once with 128 number of clusters.
From Table 6, it is evident that the space reduction using proposed method lies in the range 93.16% to 95.17% that is higher than space reduction of VQ (88.47% to 94.18%), CIQ (75.69% to 85.00%), JPEG (66.88% to 85.77%) and JPEG2000 (79.98% to 89.99%). Therefore, the proposed method performs far better compared to VQ, CIQ, JPEG, and JPEG2000 in terms of space reduction.
Table 7 shows the computed PSNR between the original image and the decompressed image using the VQ, CIQ, JPEG, JPEG2000 and proposed method. Here the proposed method takes four images together. The result shown in Table 7 shows that PSNR values of images using proposed method and existing VQ, CIQ, JPEG and JPEG2000 are similar.
In Table 8 comparative study of image quality (in terms of PSNR) between JPEG compression and proposed method is shown by maintaining required space almost same for both the methods. Quality factor (QF) of JPEG algorithm is adjusted to a value so that required space of compressed image is near to that of proposed method. It is clear from Table 8 that PSNR of proposed method is better than that of JPEG compression keeping required space almost same. For example, in case of Jelly beans image, PSNR of proposed method of Y, Cb, Cr are 37.06, 33.49 and 33.31 compared to 29.76, 32.51 and 32.58 of JPEG respectively. In ucid00006 image, PSNR of proposed method of Y, Cb, Cr are 25.82, 35.22 and 34.99 are significantly better than PSNR 22.49, 30.35 and 30.07 of JPEG compression.
Figure 9(a) to 9(e) shows the original image, decompressed image using JPEG, JPEG2000, KLT based compression method and proposed method. In JPEG and JPEG2000 quality factor (QF) is set to a specific value to keep required space almost same as proposed method. From Fig. 9, it can be clearly seen that image quality of decompressed image using proposed method is better than the JPEG, JPEG2000 and KLT based compression method.
In Table 9 comparative result of image quality (in terms of PSNR) between JPEG2000, Karhunen Loeve Transform (KLT) based compression [32] and proposed method is shown by maintaining required space near to each other. Quality factor (QF) of JPEG2000 [33] algorithm is adjusted to keep required space of compressed image is very much near to proposed method. Table 9 shows that KLT and JPEG2000 gives better PSNR than proposed method. But PSNR of Y channel is significantly better than KLT & JPEG2000.
Figure 10 shows the average percentage of space reduction using Vector Quantization, CIQ, JPEG, JPEG2000 and proposed method taking (six, five, four and three images at once). It is clearly observed that the amount of space reduction using proposed approach is significantly higher than that of VQ, CIQ, JPEG and JPEG2000.In this study, the experiment has been conducted taking four to six images together. In case of four images average memory space reduction is 92.06% and image quality is better than decompressed image taking five or six images together. Image quality of decompressed images using proposed method depends on the number of images taken ay once for compression. If the number of images increases then visual quality of individual quality degrades but achieves better compression ratio.
The graph in Fig. 11, Fig. 12 and Fig. 13 shows the space requirements versus number of images taken at once for compression for Girl, Baboon and ucid00006 images respectively.

Space requirement versus number of images taken together for Girl image of size 256 × 256.

Space requirement versus number of images taken together for Baboon image of size 512 × 512.

Space requirement versus number of images taken together for ucid00006 image of size 384 × 512.
The graph in Fig. 14 shows the image quality (PSNR) versus number of image taken at once.

Impact of number of images taken together on Image quality. X-axis is number of image, Y-axis is PSNR.
This study proposes a multi-image compression method to achieve better compression ratio where multiple images of the same size are combined together and compressed. It works on de-correlated color space. This method has been applied on standard images available in literature and images collected from UCID v.2 color image database. Experimental results show that the method achieves a higher compression ratio than VQ, JPEG and JPEG2000 while retaining almost similar image information. Future work may be focused on application of post processing technique on the decompressed image to achieve higher PSNR while keeping the same memory space requirement.
