public static void saveGif(BufferedImage[] images, String fname) {
        new File("output images/").mkdir();
        try {
            new File("output images").mkdir();
            ImageOutputStream output = new FileImageOutputStream(new File("output images/" + fname));
            GifSequenceWriter writer = new GifSequenceWriter(output, images[0].getType(), 100, true);
            for (BufferedImage bi : images) {
                writer.writeToSequence(bi);
            }
            writer.close();
            output.close();
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Perlin2d.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Perlin2d.class.getName()).log(Level.SEVERE, null, ex);
        }
    }