Usage of color information of object is one of the most popular image processing based object detection method. In this work, a method has been proposed for separating color pixels of target objects from other object color pixels in the image. A fire/flame dataset was used for the target colored object. The proposed method consists of three stage. In the first stage, the flame and non-flame color pixels, taken from this dataset, are combined in a feature matrix. In the second stage, the feature matrix is subjected to linear multiplication with a 3*3 conversion matrix whose initial values are randomly generated. The error values of the linear multiplication result are calculated by the K-means algorithm and then these error values are optimized by the Biogeography Based Optimization (BBO) algorithm. In the last stage, the optimal conversion matrix is applied on the images and the color distribution of the target color pixels in three dimensional space is examined.