void doColorQuant(File in, File out, WriteParameter.QuantAlgorithm quantAlg) throws Exception {
WriteRender wr = null;
InputStream inStream = new FileInputStream(in);
try {
ReadRender rr = new ReadRender(inStream);
wr = new WriteRender(rr, out, ImageFormat.GIF, new WriteParameter(quantAlg));
wr.render();
} finally {
IOUtils.closeQuietly(inStream);