code: private static String checkTransparentNodata(BufferedImage buffImage,
              Node node) throws Exception {
          String transparentNodata = "NA";
          boolean noData = false;
          boolean transparent = true;
          int[] bandIndexes = new int[4];
          bandIndexes[0] = 3; // A
          bandIndexes[1] = 2; // B
          bandIndexes[2] = 1; // G
          bandIndexes[3] = 0; // R
          Raster raster = buffImage.getRaster();
          int minx = raster.getMinX();
          int maxx = minx + raster.getWidth();
          int miny = raster.getMinY();
          int maxy = miny + raster.getHeight();
          int[][] bands = new int[bandIndexes.length][raster.getWidth()];
          for (int y = miny; y < maxy; y++) {
              for (int i = 0; i < bandIndexes.length; i++) {
                  raster.getSamples(minx, y, maxx, 1, bandIndexes[i], bands[i]);
              }
              for (int x = minx; x < maxx; x++) {
                  int a = bands[0][x];
                  int b = bands[1][x];
                  int g = bands[2][x];
                  int r = bands[3][x];
                  if (b == 0 && g == 0 && r == 0) {
                      noData = true;
                      if (a != 0) {
                          transparent = false;
                      }
                  }
              }
          }
          transparentNodata = (noData) ? (transparent) ? "true" : "false" : "NA";
          return transparentNodata;
      }
docs: /*
  2011-08-24 PwD check that all pixels in image with no data are
  transparent
  
  @return NA if all pixels contain data
  
  @return true if all pixels with no data are transparent (alpha channel
  value 0)
  
  @return false if any pixel with no data is non-transparent