@Override
    public Image loadImage(final String filename) {
        TextureKey key = new TextureKey(filename, false);
        key.setAnisotropy(0);
        key.setGenerateMips(false);

        Texture2D texture = (Texture2D) display.getAssetManager().loadTexture(key);
        // Fix GLES format incompatibility issue with glTexSubImage
        Renderer renderer = display.getRenderer();
        if (renderer == null || renderer.getCaps().contains(Caps.OpenGLES20)) {
            if (texture.getImage().getFormat() != Format.RGBA8) {
                com.jme3.texture.Image sourceImage = texture.getImage();
                int size = sourceImage.getWidth() * sourceImage.getHeight() * 4;
                ByteBuffer buffer = BufferUtils.createByteBuffer(size);
                com.jme3.texture.Image rgba8Image = new com.jme3.texture.Image(Format.RGBA8,
                        sourceImage.getWidth(),
                        sourceImage.getHeight(),
                        buffer,
                        sourceImage.getColorSpace());

                ImageRaster input = ImageRaster.create(sourceImage, 0, 0, false);
                ImageRaster output = ImageRaster.create(rgba8Image, 0, 0, false);
                ColorRGBA color = new ColorRGBA();

                for (int y = 0; y < sourceImage.getHeight(); y++) {
                    for (int x = 0; x < sourceImage.getWidth(); x++) {
                        output.setPixel(x, y, input.getPixel(x, y, color));
                    }
                }
                return new ImageImpl(rgba8Image);
            }
        }
        return new ImageImpl(texture.getImage());
    }
Nifty GUI BatchRenderBackend Implementation for jMonkeyEngine.

@author void
jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java