if (ge.isHeadlessInstance()) {
img = new BufferedImage(w, h,
layerId.equals("backing") ? BufferedImage.TYPE_INT_RGB
: BufferedImage.TYPE_INT_ARGB);
} else {
GraphicsConfiguration gc = ge.getDefaultScreenDevice()
.getDefaultConfiguration();
// int imageType = layerId.equals("backing") && false ? BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;
// img = new BufferedImage((int)b.width, (int)b.height, imageType);
img = gc.createCompatibleImage(w, h,
layerId.equals("backing") ? Transparency.OPAQUE
: Transparency.TRANSLUCENT);
}
ctx = (Graphics2D) img.createGraphics();
ctx.setRenderingHint(RenderingHints.KEY_ANTIALIASING,