public byte[] process() {
        colorTab = new byte[numColors * 3];
        colorHash = new HashMap<Color, Integer>();
        numColorsUsed = 0;

        for(int i = 0; i < len; i+= 3) {
            //just put the first 256 colors in the table, no worries
            //need & 0xff so 11111111 is 256 not -1, etc
            Color c = new Color(pic[i+2] & 0xff, pic[i+1] & 0xff, pic[i] & 0xff);
            if(!colorHash.containsKey(c) && numColorsUsed < numColors) {
                colorHash.put(c, numColorsUsed);
                colorTab[numColorsUsed * 3] = pic[i];
                colorTab[numColorsUsed * 3 + 1] = pic[i + 1];
                colorTab[numColorsUsed * 3 + 2] = pic[i + 2];
                numColorsUsed++;
            }
        }
        return colorTab;
    }