public void runScriptWithBuilder(String script, String destVar, WritableRenderedImage destImage) throws JiffleException { // Image bounds are taken from the destination image Rectangle imageBounds = new Rectangle( destImage.getMinX(), destImage.getMinY(), destImage.getWidth(), destImage.getHeight()); // The world bounds are the unit rectangle Rectangle2D worldBounds = new Rectangle2D.Double(0, 0, 1, 1); CoordinateTransform transform = CoordinateTransforms.unitBounds(imageBounds); JiffleBuilder builder = new JiffleBuilder(); // Set the processing area (world units) builder.worldAndNumPixels(worldBounds, destImage.getWidth(), destImage.getHeight()); // Set the script and the destination image with its transform builder.script(script).dest(destVar, destImage, transform); // This executes the script and writes the results into destImage builder.run(); } // docs end builder method