obs.waitImageLoaded();
final ImageEncoder imageEncoder = ImageEncoderRegistry.getInstance().createEncoder(mimeType);
if (imageEncoder == null)
{
throw new UnsupportedEncoderException("The encoder for mime-type '" + mimeType + "' is not available");
}
imageEncoder.encodeImage(image, outputStream, quality, alpha);
}