public void writeAnimatedGIF(Bitmap[] images, int[] delays, OutputStream os) throws Exception {
    	// Header first
    	writeHeader(os, true);
    	
    	Rect logicalScreenSize = getLogicalScreenSize(images);
    	
    	logicalScreenWidth = logicalScreenSize.width();
    	logicalScreenHeight = logicalScreenSize.height();
    	// We are going to write animated GIF, so enable animated flag
    	animated = true;
    	
    	for(int i = 0; i < images.length; i++) {
    		// Retrieve image dimension
			int imageWidth = images[i].getWidth();
			int imageHeight = images[i].getHeight();
			int[] pixels = new int[imageWidth * imageHeight];
			images[i].getPixels(pixels, 0, imageWidth, 0, 0, imageWidth, imageHeight);
			writeFrame(pixels, imageWidth, imageHeight, 0, 0, delays[i], os);
    	}
    	
    	os.write(IMAGE_TRAILER);
		os.close();    	
    }
Writes an array of BufferedImage as an animated GIF

@param images an array of BufferedImage
@param delays delays in millisecond for each frame
@param os OutputStream for the animated GIF
@throws Exception
subs/gif-revert/src/main/java/com/engineer/gif/revert/lib/AnimatedGIFWriter.java