Refactor code base, add color quantization.