When I use the following method from your examples To try To make a stencil file with PNG images:
public static Master createMaster(final int masterId, final String name, final java.awt.Image image) throws Exception {
…...process Files from Word, Excel, PowerPoint, Visio, PDF, CAD & several...process Files from Word, Excel, PowerPoint, Visio, PDF, CAD & several...