Bitmap color reduction and GIF encoding