private void computeIndexings()
    {
        //Index the images.
        imageData = new int[width][height];
        for (int x = 0; x < width; x++)
            for (int y = 0; y < height; y++)
            {
                MultiColor c = new MultiColor(colorCount);
                for (int i = 0; i < imageCount; i++)
                {
                    int col = images.get(i).getRGB(x, y);
                    //TODO: Alpha
                    if ((col & 0x80000000) == 0)
                    {
                        c.data[3 * i + 0] = -1;
                        c.data[3 * i + 1] = -1;
                        c.data[3 * i + 2] = -1;
                    } else
                    {
                        c.data[3 * i + 0] = reduce((col) & 0xFF);
                        c.data[3 * i + 1] = reduce((col >> 8) & 0xFF);
                        c.data[3 * i + 2] = reduce((col >> 16) & 0xFF);
                    }
                }

                c.calcHash();
                if (c.allTransparent())
                    imageData[x][y] = 0;
                else
                    imageData[x][y] = closestMultiColor(c);
            }
    }