A fast codebook generation algorithm for vector quantization of images