public static BufferedImage fill(BufferedImage texture, int w, int h) {
        int sizex = texture.getWidth();
        int sizey = texture.getHeight();
        BufferedImage res = new BufferedImage(w, h, 2);
        for(int i = 0; i < w/sizex; i++) for(int k = 0; k < h/sizey; k++) res.getGraphics().drawImage(texture, i*sizex, k*sizey, null);
        return res;
    }