final PngEncoder png = new PngEncoder(bv.getEntireBoardImage(),
PngEncoder.NO_ALPHA, filter, compressionLevel);
try {
final FileOutputStream outfile = new FileOutputStream(curfileImage);
byte[] pngbytes;
pngbytes = png.pngEncode();
if (pngbytes == null) {
System.out.println("Failed to save board as image:Null image"); //$NON-NLS-1$
} else {
outfile.write(pngbytes);
}