JimiImage source = Jimi.createRasterImage(wrapper.getSource());
JimiEncoder encoder = null;
if ("jpg".equals(type) || "jpeg".equals(type)) {
// JPEG
encoder = new JPGEncoder();
// the quality value does mean something here and can be specified:
if (quality >= 0.0 && quality <= 1.0) {
JPGOptions options = new JPGOptions();
options.setQuality(Math.round(quality * 100));
source.setOptions(options);