@SuppressWarnings("unchecked")
    private Image convertImageToAwt(Image source) {
        //use awt dependent classes without actual dependency via reflection
        try {
            Class clazz = Class.forName("jme3tools.converters.ImageToAwt");
            if (clazz == null) {
                return null;
            }
            Image newImage = new Image(format, source.getWidth(), source.getHeight(), BufferUtils.createByteBuffer(source.getWidth() * source.getHeight() * 4), null, ColorSpace.Linear);
            clazz.getMethod("convert", Image.class, Image.class).invoke(clazz.getDeclaredConstructor().newInstance(), source, newImage);
            return newImage;
        } catch (InstantiationException
                | IllegalAccessException
                | IllegalArgumentException
                | InvocationTargetException
                | NoSuchMethodException
                | SecurityException
                | ClassNotFoundException ex) {
        }
        return null;
    }
Add a texture for a specific map name at the location of another existing texture (on the master map).
@param texture A texture to add to the atlas.
@param mapName A freely chosen map name that can be later retrieved as a Texture.
@param sourceTextureName Name of the master map used for the location.
jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java