}
public static void writeOutGif(BufferedImage src, OutputStream os) throws IOException {
BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_ARGB);
QuantizeFilter filter=new QuantizeFilter();
filter.setSerpentine(true);
filter.setDither(true);
//filter.setNumColors(8);
filter.filter(src, dst);
//image(Quantizer.quantize(image(), 8));
try {
GifEncoder enc = new GifEncoder(dst);