// state = true if refImg is the same than img
ByteArrayOutputStream out = new ByteArrayOutputStream();
TranscoderOutput output = new TranscoderOutput(out);
PNGTranscoder t = new PNGTranscoder();
t.writeImage(img, output);
byte [] imgData = out.toByteArray();
if (refImgData == null) {
report.setErrorCode(ERROR_IMAGE_DIFFER);
report.addDescriptionEntry(ERROR_IMAGE_DIFFER, "");