public int[] parseMap(BufferedImage mapa) {
        int[] pixels = new int[width * height];
        int[] m = new int[width * height];
        int indice;
        int y;
        int x;
        
        mapa.getRGB(0, 0, width, height, pixels, 0, 15);
        
        for (y = 0; y < height; y++) {
            for (x = 0; x < width; x++) {

                indice = x + y * width;

                if (pixels[indice] == 0xFF00FF00)       m[indice] = HIERBA;
                else if (pixels[indice] == 0xFFFFFF00)  m[indice] = CAMINO;
                else if (pixels[indice] == 0xFFA0A0A0)  m[indice] = ROCA;
                else if (pixels[indice] == 0xFF00FFFF)  m[indice] = START;
                else if (pixels[indice] == 0xFFFF0000)  m[indice] = END;
            }
        }
        
        return m;
    }