AbstractColor Image quantization (CQ) is an important problem in computer graphics, image and processing. The aim of quantization is to reduce colors in an image with minimum distortion. Clustering is a widely used technique for color quantization; all colors in an image are grouped to small clusters. In this paper, we proposed a new hybrid approach for color quantization using firefly algorithm (FA) and K-means algorithm. Firefly algorithm is a swarm- based algorithm that can be used for solving optimization problems. The proposed method can overcome the drawbacks of both algorithms such as the local optima converge problem in K-means and the early converge of firefly algorithm. Experiments on three commonly used images and the comparison results shows that the proposed algorithm surpasses both the base-line technique k-means clustering and original firefly algorithm. KeywordsClustering, Color quantization, Firefly algorithm, K- means. I. INTRODUCTION OLOR image quantization or color quantization (CQ) is an image processing technique for reduction the number of colors in image, useful in the limitations of image display, data storage and transmission [1]. There are two types of color quantization algorithms [2]; first is the splitting algorithm such as: median-cut [3], center-cut [4], oc-tree [5], and the second is clustering algorithms. Color quantization by clustering can be done by grouping color points into small clusters and then finding a representative for each cluster. This clustering-based quantization problem is an optimization problem because it wants to minimize the error of quantization by minimizes the sum of distance between the center of each cluster and its members. The maximum inter-cluster distance is minimized to find the global solution of quantization image in [6]. The most popular clustering method, K-means algorithm is used in color quantization [7] and [8]. Many optimization algorithms such as swarm intelligence algorithms or nature-inspired optimization algorithms are applied for performing color quantization such as; Particle Swarm Optimization (PSO) [9], a modified artificial fish swarm algorithm [10], Bacteria Foraging Optimization [11], Honey Bee Optimization [12] A hybrid approach of a hybrid P. Jitpakdee is with Sirindhorn International Institute of Technology, Thammasat University, 131 Moo 5, Tiwanont Road, Bangkadi, Muang, Pathumthani, 12000, Thailand (e-mail: parisut@gmail.com). P. Aimmanee is with Sirindhorn International Institute of Technology, Thammasat University, 131 Moo 5, Tiwanont Road, Bangkadi, Muang, Pathumthani, 12000, Thailand (e-mail: pakinee@siit.tu.ac.th). B. Uyyanonvara is with Sirindhorn International Institute of Technology, Thammasat University, 131 Moo 5, Tiwanont Road, Bangkadi, Muang, Pathumthani, 12000, Thailand (e-mail: bunyarit@siit.tu.ac.th). of fuzzy c-means (FCM), particle swarm optimization (PSO), and genetic algorithms (GA) is proposed for color quantization [13]. One of famous bio-inspired optimization algorithm that will be used mainly in this paper is the Firefly algorithm (FA) introduced by Xin She Yang [14]. This algorithm based on the flash producing behavior of fireflies. Yang used the FA for nonlinear design problems [15] and multimodal optimization problems [16] and showed the efficiency of the FA for finding global optima. In this study, the Firefly Algorithm (FA) is applied together with K-means algorithm to cluster colors in images for color quantization. To study the performance of the our method, we used 3 difference images from The USC-SIPI Image Database [17] and evaluate results by calculating the Mean Square Error (MSE) and Peak Signal-to-Noise Ratio (PSNR). The paper is organized as follows. Section 2 briefly describes a firefly algorithm. Section 3 presents a detail of proposed method, FA+K. The experimental results are showed in Section 4. Finally, Section 5 is a conclusion of this study. II. FIREFLY ALGORITHM A Firefly Algorithm (FA) is an optimization algorithm that simulates the flash pattern and characteristics of fireflies. It first proposed by Yang [14], [15], and [16]. The Firefly Algorithm is a population-based algorithm to find the global optima of objective functions based on swarm intelligence. Each firefly is attracted by the brighter glow of other neighboring fireflies. When a couple of fireflies are father away, the attractiveness is decreasing. In Firefly algorithm, there are three idealized rules defined by Yang [14]: 1) All fireflies are unisex so that one firefly will be attracted to other fireflies regardless of their sex; 2) Attractiveness is proportional to their brightness. Thus, for any two fireflies, the less bright one will move towards the brighter one. If there is no brighter one than a particular firefly, it will move randomly; 3) the brightness of a firefly is from the objective function. For a maximization problem, the brightness can simply be proportional to the value of the objective function. The pseudo code of Firefly algorithm [14] is shown in Fig. 1. The attractiveness function β calculate from the distance ݎ ௜,௝ of the firefly is determined by: ߚ ݎ ௜,௝ ൯ൌ ߚ ఊ௥ ೔,ೕ (1) where, ߚ is the attractiveness and ߛis the light absorbtioncoefficient at the source. It should be noted that the Parisut Jitpakdee, Pakinee Aimmanee, and Bunyarit Uyyanonvara A Hybrid Approach for Color Image Quantization Using K-means and Firefly Algorithms C World Academy of Science, Engineering and Technology International Journal of Computer and Information Engineering Vol:7, No:5, 2013 600 International Scholarly and Scientific Research & Innovation 7(5) 2013 scholar.waset.org/1307-6892/6965 International Science Index, Computer and Information Engineering Vol:7, No:5, 2013 waset.org/Publication/6965