# A Mixed Method with Effective Color Reduction
## 4 Results and Discussion
### Results of Other Methods
These results are similar in the number of cases to those obtained when KM is compared to BS+ITATCQ, although the range is different. In this case the improvement obtained by BS+ITATCQ compared to WAT CQ is 10.42% at most. Figure 4: Average execution time (milliseconds) of several color quantization methods. The results of BS+ITATCQ in subfigure (**a**) correspond to the iteration 5, while the results in subfigure (**b**) correspond to iteration 25 (\(q\): palette size). Figure 5: Average percentage of error reduction of BS+ITATCQ3 compared to WU, OC, VB, MC and NQ (\(q\): palette size). ABC+ATCQ is the method which obtains better global errors when compared to the proposed method. Nevertheless, it is also the most time consuming method among those considered. It should be noted that the improvement obtained by ABC+ATCQ is less than 5% for the majority of the cases (in 59 out of 65 cases improved by this method). The results reported for KM correspond to tests that take random initial centroids. However, a second group of tests was performed using the quantized palette generated by BS to define the initial centroids of K-means. The results of these tests appear in Tables A6-A9 labeled as BSKM. Although BSKM and BS+ITATCQ3 have some similarities, there are several differences between both solutions:  
* Each iteration of K-means considers an initial set of centroids and uses these centroids to associate each pixel with a cluster. The values of the centroids are the same until the end of the iteration. On the other hand, the colors used by ITATCQ to associate an ant to a subtree are updated during each iteration of the algorithm. When a new ant is associated with a subtree, the color of that subtree is updated to include the color of the ant. Therefore, when the next ant is processed, the set of colors used to decide its destination is different from the set considered for the previous ant. * K-means recomputes all the centroids at the end of each iteration. In contrast, ITATCQ does not recompute the colors of the palette at the end of each iteration, which accelerates the method. * The final palette defined by K-means includes the average color of each cluster defined during the last iteration. Nevertheless, the colors of the final palette defined by ITATCQ are computed based on the color of all the ants connected to each subtree throughout all the iterations of the algorithm. When ITATCQ is applied to the result of BS, the colors of the palette defined by BS are also used to compute the final color of each element of the palette. It can be observed that BSKM obtains better error values than BS+ITATCQ3 in many cases, although it requires much more time. BS+ITATCQ3 obtains better error than BSKM only in 29 out of the 96 cases. For the remaining 67 cases, the reduction in the error obtained by BSKM is less than 4% for 56 cases, ranging between \([4\%,6\%]\) for six cases and exceeding 7% for only two cases. Figure 6 shows the average percentage of error reduction obtained by BS+ITATCQ3 when compared to WATCQ, ATCQ+FA, SFLA, KM, BSKM and ABC+ATCQ. The figure confirms that ABC+ATCQ and BSKM can obtain images with less error than BS+ITATCQ3, although the average difference is less than 4% for all the palettes. Figure 6: Average percentage of error reduction of BS+ITATCQ3 compared to WATCQ, ATCQ+FA, SFLA, KM, BSKM and ABC+ATCQ (\(q\): palette size). Figure 7 compares the average MSE obtained by each method for the entire test set. The results are represented considering each palette independently and also considering the results for all the palettes as a whole. The methods were ordered by decreasing error for the case that considers all the palettes as a whole and this order was used in the five subfigures. The results considered for the proposed method are those of BS+ITATCQ3 at iteration 5. This figure confirms that the proposed method is among those that generate the best quality images of all the compared methods. Figure 7: Average MSE obtained by each quantization method for all the images in the test set.