* extension with supported format.
*/
public static Image encode(String name, RenderedImage image,
float quality, boolean encodeAlpha)
throws IOException {
ImageEncoder encoder = ImageEncoders.newInstance(getFormat(name));
encoder.setQuality(quality);
encoder.setEncodingAlpha(encodeAlpha);
return new AImage(name, encoder.encode(image));
}