Next Article in Journal
Weak Embeddable Hypernear-Rings
Previous Article in Journal
The Solutions of Non-Integer Order Burgers’ Fluid Flowing through a Round Channel with Semi Analytical Technique
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Fast Color Quantization by K-Means Clustering Combined with Image Sampling

Institute of Automatic Control, Silesian University of Technology, Akademicka 16, 44-100 Gliwice, Poland
*
Author to whom correspondence should be addressed.
Symmetry 2019, 11(8), 963; https://doi.org/10.3390/sym11080963
Submission received: 18 May 2019 / Revised: 10 July 2019 / Accepted: 17 July 2019 / Published: 1 August 2019

Abstract

:
Color image quantization has become an important operation often used in tasks of color image processing. There is a need for quantization methods that are fast and at the same time generating high quality quantized images. This paper presents such color quantization method based on downsampling of original image and K-Means clustering on a downsampled image. The nearest neighbor interpolation was used in the downsampling process and Wu’s algorithm was applied for deterministic initialization of K-Means. Comparisons with other methods based on a limited sample of pixels (coreset-based algorithm) showed an advantage of the proposed method. This method significantly accelerated the color quantization without noticeable loss of image quality. The experimental results obtained on 24 color images from the Kodak image dataset demonstrated the advantages of the proposed method. Three quality indices (MSE, DSCSI and HPSI) were used in the assessment process.

1. Introduction

Color image quantization plays an auxiliary, but still very important role in such tasks of color image processing as image compression, image segmentation, image watermarking, etc. This operation significantly reduces the number of colors in the image and at the same time it should maintain a quantized image similar to the original image. Among the color quantization methods, two large groups can be distinguished, i.e., splitting techniques, e.g., median-cut (MC) [1], Wu’s algorithm [2] and clustering techniques, e.g., K-Means (KM) technique [3]. The latter technique gives very good results, but its computational complexity makes for a long computation time.
The results obtained using the KM technique depend on the initialization, i.e., on how we determine the initial centers of the clusters. Their random selection, usually used in the KM technique, leads to unrepeatable results. The use of splitting quantization in the form of MC or Wu methods can provide a deterministic initialization of KM [4].
The high computational complexity of KM results from the necessity of carrying out a very large number of comparisons between input data. This is especially true for images that contain millions of pixels. Therefore, the use of appropriate data structures and reducing the number of unnecessarily calculated distances between data allows for reducing the time required for KM [5]. Another approach, particularly useful in color quantization, can be the operation on a small sample of the image. Then, the problem of how to sample the image remains to be solved: randomly or systematically? The other challenge is to define a proper size of such sample to receive accurate results and shorter computational time [6]. In this paper by Bejarano et al., the maximal size of the sample was about 0.5% of the entire data and the clustering results were accurate and achieved in a much shorter time. A reduction in the number of pixels reduced the number of unique colors and then we could carry out the color quantization, for example, on a few thousand colors, not on a few million colors. The result should be a small loss of image quality and a significantly shorter time for the whole operation. The three main contributions of the proposed method are as follows:
  • An improved color quantization method may result in high image quality and short quantization time simultaneously.
  • Our method limits its working area to the stage of determining the color palette (initialization, clustering) to the image downsampled by the Nearest Neighbor Interpolation (NNI).
  • The quality indices of our quantized images compared with results for the method based on a limited sample of pixels (coreset-based algorithm) show an advantage of our method.
This paper is organized as follows: Section 2 is a short review of the literature on the applications related to the simultaneous color quantization and image downsampling. The proposed method is elaborated in details in Section 3. Experimental results and performance analyses are presented in Section 4. Finally, conclusions are given in Section 5.

2. Related Work

A theoretical basis for solving our problem is the image interpolation. This operation occurs during some image processing stages such as resizing (resampling), rectification, inpainting and morphing. The problem of image interpolation has been widely described in the work [7]. Commonly used non-adaptive interpolation techniques are nearest neighbor interpolation (NNI), bilinear interpolation and bicubic interpolation. NNI is a simplest interpolation method that just replicates the nearest neighboring pixels. This means that, for color images, as a result of interpolation, no new colors are created. Thus, image upsampling does not increase the number of colors in the image and image downsampling can only reduce the number of colors, but their values will remain unchanged.
Different researchers have focused on using image sampling for acceleration of color quantization processes. In 2002, Papamarkos et al. [8] presented an idea of image downsampling via a fractal scanning technique based on Hilbert’s space-filling curve for their Adaptive Color Reduction (ACR) algorithm. In this paper, the advantages of such fractal scanning in relation to a conventional raster scanning were highlighted. However, the primary goal of this downsampling was to speed up the entire process, especially important in the case of large images.
In 2014, Szilagyi and coworkers [9] preceded the KM-based color quantization by a special preprocessing consisting of static color quantization on about 140,000 colors and the color histogram computation with rejection of the least frequent colors. The key parameter of preprocessing is the percentage of image pixels included in the clustering process. The resignation from 2–5% pixels of the original image reduced the number of colors to 500–5000 colors and shortened the image quantization time (2–3 speedup ratio) without losing the image details.
In the work by Valenzuela, Celebi and Schaefer [10], an accelerated KM version was proposed that utilizes downsampling (decimation) of the input image, a non-deterministic KM++ initialization algorithm, efficient coreset construction and K-Means clustering. The authors used the name coremeans (CM) for their color quantization method. The decimation is the simple transformation of the discrete image, consisting of keeping every n-th sample and rejecting the rest. Two values of the decimation factor d f were considered in the article: { 2 , 4 } and marked as CM2 and CM4. The KM++ algorithm is known from the literature [11]. The coreset was constructed based on a downsampled original image and on the initial set of centers from the KM++ algorithm. The Lucic et al. algorithm [12] was adapted to the coreset construction. Four values of the coreset fraction c f = 1 / 2 , 3 / 8 , 1 / 4 , 1 / 8 were tested. In this paper, the CM method tests were performed on only four images. CM was significantly faster than the KM method and produced the quantized images of a similar quality to KM results. A detailed comparison of CM results and the results of the proposed method are given in Section 4.
Color quantization together with image sampling have been applied in pixel art [13], which is reminiscent of the hand-crafted work of pixel artists. Pixel art images, resulting from the automatic conversion of the color input image to a pixelated (iconic) output image, use low spatial resolution and a small color palette. The described conversion procedure contained two parts: SLIC (Simple Linear Iterative Clustering) algorithm that segments the input image into superpixels and an MCDA (Mass Constrained Deterministic Annealing) fuzzy clustering algorithm. As another application of our main operations, namely color quantization and image sampling, we can see a wireless image sensor network with reduced battery consumption in its nodes [14]. This network was used for monitoring natural environment phenomena e.g., bird nest monitoring. Both operations significantly reduced the amount of transferred data between cameras and server and simultaneously reduced the energy consumption. This approach worked as a lossy image compression algorithm. However, compression was limited by the need to maintain a sufficient image quality needed for labeling by domain experts. For authors, the most beneficial color quantization method was quantization with a fixed palette (8, 16, 32 colors) and the bilinear interpolation algorithm for downsampling.

3. The Proposed Method

The main task of this article is to assess the impact of generating a color palette from a sample of image pixels instead of the whole image on the computation time and the quality of quantization. In 2010, Palus and Frackiewicz applied Wu’s splitting method as an effective method for KM initialization [4]. Figure 1 presents an idea of color quantization where an original full resolution image is a starting point for all processes i.e., initialization (Wu’s algorithm), clustering (KM) and final pixel mapping. The time complexity of this quantization method based on K-Means is O ( n · k · d · i ) [15], where: n is the number of pixels, k is the number of expecting colors, d is the number of color components and i is the number of iterations.
In contrast to this idea, the new proposed method (Figure 2) uses the original image only for pixel mapping. Both stages—initialization and clustering—are working on downsampled (DS) images. For downsampling with a d f factor, we decided to use popular and fast nearest neighbor interpolation. Such an approach should significantly reduce computational requirements and shorten the color quantization time. The time complexity of the proposed quantization method based on K-Means with downsampling is O ( d f · n · k · d · i ) [15], where: d f is a downsampling factor, n is the number of pixels, k is the number of expecting colors, d is the number of color components and i is the number of iterations. Because the downsampling factor is a fraction, running time is shortened.
Nearest neighbor interpolation is used for an up- or downscaling algorithm in which vertical and horizontal scaling ratios are calculated as:
s x = w 1 w 2 , s y = h 1 h 2 ,
where: w 1 , h 1 are the width and height of an original image, and w 2 , h 2 are the width and height of the image after enlarging/shrinking. Finally, the results of multiplying x , y coordinates and ratios are rounding to the nearest integer value. In this way, we receive the coordinates of pixels used in the downscaled image.
Wu’s quantization algorithm as a typical splitting method uses a statistical exploration of colors appearing in the original image. It is based on orthogonal bipartitioning and splits the RGB cube into k boxes, but, at each step, the box with the largest color variance is split along the axis that minimizes the sum of the variances on both sides. The author of the algorithm efficiently solved the problem of how to compute three-dimensional color statistics (means and variances) for these boxes. The means of the colors in the final boxes are selected as a color palette. Other details of the algorithm implementation can be found in Ref. [16].
The KM algorithm consists of four stages:
  • Initialization of the KM algorithm with cluster centers from Wu’s algorithm,
  • For each pixel x i that represents RGB components, compute its membership m ( c k | x i ) in each cluster center c k :
    m ( c k | x i ) = 1 , if l = arg min k x i c k 2 , 0 , otherwise ,
  • Recompute location of each center c k from all pixels x i based on their memberships:
    c k = i = 1 n m ( c k | x i ) x i i = 1 n m ( c k | x i ) ,
  • Repeat two former stages until convergence.
All algorithms used in the proposed method were implemented in Visual C++ and the experiments were conducted on a PC computer running under a Windows operating system, with an Intel Core i7 920 @ 2.67 GHz (Santa Clara, CA, USA) and 8 GB RAM.

4. Experimental Results

In this work, two tests were performed to check the quality and efficiency of the proposed fast color quantization method. For each test image, the quantization into 32, 64, 128 and 256 colors was carried out and quality indices and CPU time were calculated. Generating a color palette was performed on all pixels of the image where the downsampling factor was 1 / 1 and on eight subsets of pixels obtained by NNI on the original image, where the downsampling factor was: 1 / 2 , 1 / 4 , 1 / 8 , 1 / 16 , 1 / 32 , 1 / 64 , 1 / 128 and 1 / 256 . Finally, nine quantization results were obtained for each test image, each number of colors, the quality indices were calculated and CPU time was measured.
The most popular quality index widely used in the color image quantization is the MSE and the version for color images is defined as:
M S E = 1 3 M N i = 1 M j = 1 N ( R i j R i j * ) 2 + ( G i j G i j * ) 2 + ( B i j B i j * ) 2 ,
where: M N represents the image resolution, R i j , G i j and B i j are the color components of the pixel ( i , j ) in the original image and R i j * , G i j * , B i j * are the color components of this pixel in the quantized image. This index is the same as the objective function used in the K-Means technique.
In the last few years, many perceptual indices for image quality assessment (IQA) have been developed. A good example of such index is the DSCSI (Directional Statistics based Color Similarity Index) [17], which consists of three steps. The first step is the image transformation from the RGB into the S-CIELAB color space. In a second step, the local features for color similarity are calculated for three color components: hue, chroma and lightness. In this way, we obtain the following six features: the hue mean similarity, the hue dispersion similarity, the chroma mean similarity, the chroma contrast similarity, the lightness contrast similarity and the lightness structural similarity. In the third step, these six features are combined into two scores: the chromatic similarity S C and achromatic similarity S A , which are directly used in the final DSCSI formula:
Q ( I , I * ) = S A · S C λ ,
where: I—original image, I * —distorted image and λ is a weighting factor. The smaller the difference between the original and distorted image, the value of DSCSI metric is closer to 1.
The last considered image quality index is named HPSI (Haar wavelet-based Perceptually Similarity Index) [18]. HPSI is based on the coefficients of three stages of a discrete Haar wavelet transform. These coefficients are used for assessment of local similarities between two compared images. This index uses the six simple 2D Haar wavelet filters to detect horizontal and vertical edges. It is built in both local similarity maps (horizontal and vertical) and both weight functions. Additionally, a nonlinear mapping in the form of the logistic function is introduced in the HPSI computation process. The usefulness of both new indices to assess the image quality after color quantization show the current works [19,20,21].
The first test was performed on four color images: Baboon, Lena, Pepper and Pills, which are shown in Figure 3, to compare results with a method based on the coreset sampling [10]. Baboon, Lena and Peppers are the test images with 512 × 512 pixels and the Pills with 800 × 519 pixels. The article, describing coreset sampling in color quanizations by K-Means, presents results of MSE and CPU time for the original image and four downsampled images with the following factors: 1 / 2 , 3 / 8 , 1 / 4 , and 1 / 8 . The authors used a non-deterministic KM++ initialization method and therefore they present the mean and standard deviation values of the performance measures for each quantized image. The fast quantization method proposed in this article, based on NNI and Wu’s splitting initialization algorithm, allows for obtaining deterministic results. Table 1, Table 2, Table 3 and Table 4 show a comparison of the mean MSE values for the two versions of the coreset-based algorithm and for the proposed NNI method in the case of 32, 64,128, and 256 colors, respectively. Table 5, Table 6, Table 7 and Table 8 contain CPU times for each method in milliseconds. Figure 4 and Figure 5 show the dependencies of the obtained speedup of calculations depending on the value of the downsampling factor for k = 128 and k = 256 where the advantage of the proposed method is significant. The visualization of the results was limited to the cases of k = 128 and k = 256, for which the predominance of the proposed method is the most visible. For cases k = 32 and k = 64, the results are presented in the tables only.
The second test was performed on 24 images from the Kodak image dataset [22] where each standard resolution image is either 768 × 512 pixels or 512 × 768 pixels and they were shown in Figure 6. In addition, the same images of high resolution (3072 × 2048 or 2048 × 3072 pixels) are also available in this dataset.
Figure 7, Figure 8 and Figure 9 show the box plots obtained for all images from the Kodak image dataset. In Figure 7, these are plots for the classic MSE quality index, while Figure 8 and Figure 9 contain quality assessments obtained for two new indices: DSCSI and HPSI. As can be seen, the decrease in image quality associated with sampling up to 1/128 is small and the change in quantization time is significant as shown in Table 9. This situation occurs for all three indices of image quality.
The maximal speedup obtained in color quantization of 24 images was equal to 357 in the case of downsampling factor equal to 1/256 and a palette of 256 colors. In this case, however, the values of the quality indices deteriorated noticeably. On the other hand, such quality dropping was not observed for the case of the downsampling factor equal to 1/128, where the maximal speedup was equal to 166.
The final stage of research on the Kodak image dataset was concerned with input images of different resolutions: standard and high. In the case of high resolution images, there was no noticeable decrease in image quality due to the reduction of the downsampling factor to the value 1/256 (Figure 10).

5. Conclusions

Color quantization is still one of the important image operations. Hence, it is of great significance to design a fast color quantization method generating high quality quantized images. Such images are the result of the KM method with deterministic initialization by means of Wu’s algorithm. Unfortunately, this is not a fast method. In this paper, we introduced an improved method, which significantly accelerated the quantization (sometimes a few hundred times) while not significantly lowering the quality of the obtained image. It should be noted that not only the classic MSE index was used to assess the quantized image, but also the DSCSI and HPSI indices strongly related to the observer’s visual perception. The improvement of the method’s operation consisted in the application downsampling of the input image through the NNI. The article shows that, the higher the spatial resolution of the image, the smaller the dependence of the result obtained by the improved method on the number of colors in the palette. In the future, we will analyze the usefulness of our method to other even more time-consuming clustering-based quantization techniques such as Fuzzy C-Means (FCM), K-Harmonic Means (KHM), etc.

Author Contributions

Conceptualization, M.F. and H.P.; methodology, M.F.; software, A.M.; validation, M.F. and H.P.; investigation, M.F.; resources, M.F.; data curation, M.F.; writing—original draft preparation, M.F.; writing—review and editing, M.F.; visualization, M.F.; supervision, H.P.

Funding

This work was supported by the Polish Ministry for Science and Education under internal grant 02/010/BK-19/0143 for the Institute of Automatic Control, Silesian University of Technology, Gliwice, Poland.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Heckbert, P. Color image quantization for frame buffer display. ACM SIGGRAPH Comput. Graph. 1982, 16, 297–307. [Google Scholar] [CrossRef] [Green Version]
  2. Wu, X. Efficient statistical computations for optimal color quantization. In Graphic Gems II; Arvo, J., Ed.; Academic Press: New York, NY, USA, 1991; pp. 126–133. [Google Scholar]
  3. MacQueen, J. Some methods for classification and analysis of multivariate observations. In Proceedings of the 5th Berkeley Symposium on Mathematics, Statistics, and Probabilities; University of California Press: Berkeley, CA, USA, 1967; pp. 281–297. [Google Scholar]
  4. Palus, H.; Frackiewicz, M. New approach for initialization of k-means technique applied to color quantization. In Proceedings of the 2010 2nd International Conference on Information Technology, (2010 ICIT), Gdansk, Poland, 28–30 June 2010; pp. 205–209. [Google Scholar]
  5. Kanungo, T.; Mount, D.M.; Netanyahu, N.S.; Piatko, C.D.; Silverman, R.; Wu, A.Y. An efficient k-means clustering algorithm: Analysis and implementation. IEEE Trans. Pattern Anal. Mach. Intell. 2002, 7, 881–892. [Google Scholar] [CrossRef]
  6. Bejarano, J.; Bose, K.; Brannan, T.; Thomas, A.; Adragni, K.; Neerchal, N.K.; Ostrouchov, G. Sampling within k-Means Algorithm to Cluster Large Datasets; UMBC Student Collection, University of Maryland: Baltimore, MD, USA, 2011. [Google Scholar]
  7. Sinha, P.K. Image Acquisition and Preprocessing for Machine Vision Systems; International Society for Optics and Photonics (SPIE): Bellingham, WA, USA, 2012. [Google Scholar]
  8. Papamarkos, N.; Atsalakis, A.E.; Strouthopoulos, C.P. Adaptive color reduction. IEEE Trans. Syst. Man Cybern. Part B Cybern. 2002, 32, 44–56. [Google Scholar] [CrossRef] [PubMed]
  9. Szilágyi, L.; Dénesi, G.; Szilágyi, S.M. Fast color reduction using approximative c-means clustering models. In Proceedings of the 2014 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE), Beijing, China, 6–11 July 2014; pp. 194–201. [Google Scholar]
  10. Valenzuela, G.; Celebi, M.E.; Schaefer, G. Color quantization using coreset sampling. In Proceedings of the 2018 IEEE International Conference on Systems, Man, and Cybernetics, Miyazaki, Japan, 7–10 October 2018; pp. 2096–2101. [Google Scholar]
  11. Arthur, D.; Vassilvitskii, S. k-means++: The advantages of careful seeding. In Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, New Orleans, LA, USA, 7–9 January 2007; pp. 1027–1035. [Google Scholar]
  12. Lucic, M.; Bachem, O.; Krause, A. Strong Coresets for Hard and Soft Bregman Clustering with Applications to Exponential Family Mixtures. arXiv 2015, arXiv:1508.05243. [Google Scholar]
  13. Gerstner, T.; DeCarlo, D.; Alexa, M.; Finkelstein, A.; Gingold, Y.; Nealen, A. Pixelated image abstraction with integrated user constraints. Comput. Graph. 2013, 37, 333–347. [Google Scholar] [CrossRef]
  14. Ahn, J.; Park, J.; Park, D.; Paek, J.; Ko, J. Convolutional neural network-based classification system design with compressed wireless sensor network images. PLoS ONE 2018, 13, e0196251. [Google Scholar] [CrossRef] [PubMed]
  15. Celebi, M.E. Partitional Clustering Algorithms; Springer: Berlin, Germany, 2014. [Google Scholar]
  16. Timmerman, B. Wu’s Color Quantizer. Available online: https://gist.github.com/bert/1192520 (accessed on 22 July 2019).
  17. Lee, D.; Plataniotis, K.N. Towards a full-reference quality assessment for color images using directional statistics. Image Process. IEEE Trans. 2015, 24, 3950–3965. [Google Scholar]
  18. Reisenhofer, R.; Bosse, S.; Kutyniok, G.; Wiegand, T. A Haar Wavelet-Based Perceptual Similarity Index for Image Quality Assessment. arXiv 2016, arXiv:1607.06140. [Google Scholar] [CrossRef]
  19. Frackiewicz, M.; Palus, H. New image quality metric used for the assessment of color quantization algorithms. In Proceedings of the Ninth International Conference on Machine Vision, SPIE, Nice, France, 18–20 November 2016; p. 103411G. [Google Scholar]
  20. Palus, H.; Frackiewicz, M. Further applications of the DSCSI metric for evaluating color quantization. In Proceedings of the Ninth International Conference on Machine Vision, SPIE, Nice, France, 18–20 November 2016; p. 103411H. [Google Scholar]
  21. Frackiewicz, M.; Palus, H. K-Means color image quantization with deterministic initialization: New image quality metrics. In Proceedings of the International Conference Image Analysis and Recognition, Povoa de Varzim, Portugal, 27–29 June 2018; pp. 56–61. [Google Scholar]
  22. Kodak Images. Available online: http://r0k.us/graphics/kodak/ (accessed on 22 July 2019).
Figure 1. Idea of the previous color quantization method.
Figure 1. Idea of the previous color quantization method.
Symmetry 11 00963 g001
Figure 2. Idea of proposed color quantization method.
Figure 2. Idea of proposed color quantization method.
Symmetry 11 00963 g002
Figure 3. Test images: (a) Baboon, (b) Lena, (c) Peppers, (d) Pills.
Figure 3. Test images: (a) Baboon, (b) Lena, (c) Peppers, (d) Pills.
Symmetry 11 00963 g003
Figure 4. Speedup vs. MSE for 128 colors.
Figure 4. Speedup vs. MSE for 128 colors.
Symmetry 11 00963 g004
Figure 5. Speedup vs. MSE for 256 colors.
Figure 5. Speedup vs. MSE for 256 colors.
Symmetry 11 00963 g005
Figure 6. Kodak image dataset.
Figure 6. Kodak image dataset.
Symmetry 11 00963 g006
Figure 7. MSE values for Kodak image dataset with different downsampling factors.
Figure 7. MSE values for Kodak image dataset with different downsampling factors.
Symmetry 11 00963 g007
Figure 8. DSCSI values for the Kodak image dataset with different downsampling factors.
Figure 8. DSCSI values for the Kodak image dataset with different downsampling factors.
Symmetry 11 00963 g008
Figure 9. HPSI values for the Kodak image dataset with different downsampling factors.
Figure 9. HPSI values for the Kodak image dataset with different downsampling factors.
Symmetry 11 00963 g009
Figure 10. MSE values for Kodak images with standard and high resolutions.
Figure 10. MSE values for Kodak images with standard and high resolutions.
Symmetry 11 00963 g010
Table 1. MSE values for 32 colors.
Table 1. MSE values for 32 colors.
c f , d f NNICM2CM4NNICM2CM4NNICM2CM4NNICM2CM4
BaboonLenaPeppersPills
1378378378126120120234233233204203203
1/2379383385124121123233232236210205206
1/4376382395123122124233234240208205208
1/8381385398123122125237235244206203208
1/16392N/AN/A121N/AN/A238N/AN/A207N/AN/A
1/32388N/AN/A123N/AN/A238N/AN/A207N/AN/A
1/64384N/AN/A123N/AN/A237N/AN/A207N/AN/A
1/128412N/AN/A122N/AN/A242N/AN/A207N/AN/A
1/256400N/AN/A132N/AN/A249N/AN/A212N/AN/A
Table 2. MSE values for 64 colors.
Table 2. MSE values for 64 colors.
c f , d f NNICM2CM4NNICM2CM4NNICM2CM4NNICM2CM4
BaboonLenaPeppersPills
1240238238757373138137137117114114
1/2241242248737479140137141115114117
1/4243243251757477140138144113115117
1/8247245258757579140139146114115121
1/16243N/AN/A75N/AN/A139N/AN/A113N/AN/A
1/32249N/AN/A75N/AN/A138N/AN/A117N/AN/A
1/64249N/AN/A76N/AN/A142N/AN/A116N/AN/A
1/128256N/AN/A78N/AN/A143N/AN/A120N/AN/A
1/256263N/AN/A80N/AN/A154N/AN/A124N/AN/A
Table 3. MSE values for 128 colors.
Table 3. MSE values for 128 colors.
c f , d f NNICM2CM4NNICM2CM4NNICM2CM4NNICM2CM4
BaboonLenaPeppersPills
1156152152484747858484696767
1/2157157162484749858689686870
1/4157158167484851868792696871
1/8158160172484952868894686973
1/16157N/AN/A48N/AN/A87N/AN/A68N/AN/A
1/32159N/AN/A49N/AN/A87N/AN/A69N/AN/A
1/64163N/AN/A50N/AN/A90N/AN/A71N/AN/A
1/128172N/AN/A52N/AN/A95N/AN/A73N/AN/A
1/256174N/AN/A54N/AN/A100N/AN/A76N/AN/A
Table 4. MSE values for 256 colors.
Table 4. MSE values for 256 colors.
c f , d f NNICM2CM4NNICM2CM4NNICM2CM4NNICM2CM4
BaboonLenaPeppersPills
1999797313030545454424141
1/2100101107313133545659424244
1/4100103109313234545761424345
1/8101105114313335555863424447
1/16102N/AN/A32N/AN/A56N/AN/A42N/AN/A
1/32105N/AN/A32N/AN/A57N/AN/A43N/AN/A
1/64108N/AN/A34N/AN/A59N/AN/A45N/AN/A
1/128113N/AN/A35N/AN/A64N/AN/A47N/AN/A
1/256119N/AN/A38N/AN/A68N/AN/A50N/AN/A
Table 5. CPU times for 32 colors.
Table 5. CPU times for 32 colors.
c f , d f NNICM2CM4NNICM2CM4NNICM2CM4NNICM2CM4
BaboonLenaPeppersPills
1345443443124477477154474474828647647
1/215513701166214991217913271021343201233
1/42016965540841645068452491634122
1/84536857204003130356285282568
1/1615N/AN/A21N/AN/A12N/AN/A16N/AN/A
1/329N/AN/A13N/AN/A4N/AN/A11N/AN/A
1/646N/AN/A4N/AN/A2N/AN/A5N/AN/A
1/1282N/AN/A4N/AN/A1N/AN/A3N/AN/A
1/2562N/AN/A2N/AN/A1N/AN/A3N/AN/A
Table 6. CPU times for 64 colors.
Table 6. CPU times for 64 colors.
c f , d f NNICM2CM4NNICM2CM4NNICM2CM4NNICM2CM4
BaboonLenaPeppersPills
132684984921388484415484284256513341334
1/2199143612324915131207914181293893313252
1/410175464727987150759673671697138
1/834382343442734305093614687174
1/1630N/AN/A13N/AN/A12N/AN/A77N/AN/A
1/3218N/AN/A11N/AN/A4N/AN/A21N/AN/A
1/6411N/AN/A10N/AN/A2N/AN/A11N/AN/A
1/1286N/AN/A4N/AN/A1N/AN/A6N/AN/A
1/2563N/AN/A2N/AN/A1N/AN/A3N/AN/A
Table 7. CPU times for 128 colors.
Table 7. CPU times for 128 colors.
c f , d f NNICM2CM4NNICM2CM4NNICM2CM4NNICM2CM4
BaboonLenaPeppersPills
147117061706247165716577501598159880024922492
1/22331584156188162615030714611464863484286
1/41468147912583689221881761981805157
1/859434474748845774114619695088
1/1666N/AN/A31N/AN/A38N/AN/A86N/AN/A
1/3249N/AN/A20N/AN/A32N/AN/A31N/AN/A
1/6417N/AN/A10N/AN/A16N/AN/A16N/AN/A
1/1288N/AN/A5N/AN/A7N/AN/A10N/AN/A
1/2564N/AN/A3N/AN/A3N/AN/A6N/AN/A
Table 8. CPU times for 256 colors.
Table 8. CPU times for 256 colors.
c f , d f NNICM2CM4NNICM2CM4NNICM2CM4NNICM2CM4
BaboonLenaPeppersPills
1126031523152112430263026139029292929322346064606
1/25261796190339213720556416731868753830364
1/43688981052811047111572890986121989199
1/82095225814357570144490583081046108
1/1693N/AN/A55N/AN/A113N/AN/A243N/AN/A
1/3261N/AN/A35N/AN/A49N/AN/A65N/AN/A
1/6434N/AN/A21N/AN/A29N/AN/A28N/AN/A
1/12811N/AN/A10N/AN/A9N/AN/A25N/AN/A
1/2565N/AN/A4N/AN/A4N/AN/A7N/AN/A
Table 9. CPU times (in milliseconds) for the Kodak image dataset.
Table 9. CPU times (in milliseconds) for the Kodak image dataset.
d f k
3264128256
136165014652500
1/21613666431106
1/480177347565
1/84676165298
1/16224475134
1/3211213768
1/646111932
1/12835715
1/2562347

Share and Cite

MDPI and ACS Style

Frackiewicz, M.; Mandrella, A.; Palus, H. Fast Color Quantization by K-Means Clustering Combined with Image Sampling. Symmetry 2019, 11, 963. https://doi.org/10.3390/sym11080963

AMA Style

Frackiewicz M, Mandrella A, Palus H. Fast Color Quantization by K-Means Clustering Combined with Image Sampling. Symmetry. 2019; 11(8):963. https://doi.org/10.3390/sym11080963

Chicago/Turabian Style

Frackiewicz, Mariusz, Aron Mandrella, and Henryk Palus. 2019. "Fast Color Quantization by K-Means Clustering Combined with Image Sampling" Symmetry 11, no. 8: 963. https://doi.org/10.3390/sym11080963

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop