We propose a heuristic approach to color quantize images with contextual information taken into consideration. The idea is to locate the regions of an image having the greatest need for colors, and allocate more quantization levels to them. We achieve this by scanning the elements of the input image in a way determined by their local intensity and selecting the color representatives that comprise the color map according to their local popularity. The overall performance of the color quantization algorithm is evaluated on a representative set of artificial and real images. The experimental results indicate good performance of our proposed algorithm with the capability to focus on the regions of an image having important color information.