code: public static void bufferedToGray(DataBufferInt buffer, WritableRaster src, GrayU8 dst) {
  		int[] srcData = buffer.getData();
  
  		byte[] data = dst.data;
  
  		int srcStride = stride(src);
  		int srcOffset = getOffset(src);
  
  
  		//CONCURRENT_BELOW BoofConcurrency.loopFor(0, dst.height, y -> {
  		for (int y = 0; y < dst.height; y++) {
  			int indexSrc = srcOffset + y*srcStride;
  			int indexDst = dst.startIndex + y * dst.stride;
  			for (int x = 0; x < dst.width; x++) {
  
  				int rgb = srcData[indexSrc++];
  
  				int r = (rgb >>> 16) & 0xFF;
  				int g = (rgb >>> 8) & 0xFF;
  				int b = rgb & 0xFF;
  
  				int ave = (r + g + b) / 3;
  
  				data[indexDst++] = (byte) ave;
  			}
  		}
  		//CONCURRENT_ABOVE });
  	}
docs: A faster convert that works directly with a specific raster