code: public static void bufferedToGray(DataBufferByte buffer, WritableRaster src, GrayU8 dst) {
  		byte[] srcData = buffer.getData();
  
  
  		int numBands = src.getNumBands();
  
  		int size = dst.getWidth() * dst.getHeight();
  
  		int srcStride = stride(src);
  		int srcOffset = getOffset(src);
  		int srcStrideDiff = srcStride-src.getNumDataElements()*dst.width;
  
  		if(BoofConcurrency.USE_CONCURRENT ) {
  			if (numBands == 3) {
  				ImplConvertRaster_MT.from_3BU8_to_U8(srcData, srcStride, srcOffset, dst);
  			} else if (numBands == 1) {
  				ImplConvertRaster_MT.from_1BU8_to_U8(srcData, size, srcStride, srcOffset, srcStrideDiff, dst);
  			} else if (numBands == 4) {
  				ImplConvertRaster_MT.from_4BU8_to_U8(srcData, srcStride, srcOffset, dst);
  			} else {
  				throw new RuntimeException("Unexpected number of bands found. Bands = " + numBands);
  			}
  		} else {
  			if (numBands == 3) {
  				ImplConvertRaster.from_3BU8_to_U8(srcData, srcStride, srcOffset, dst);
  			} else if (numBands == 1) {
  				ImplConvertRaster.from_1BU8_to_U8(srcData, size, srcStride, srcOffset, srcStrideDiff, dst);
  			} else if (numBands == 4) {
  				ImplConvertRaster.from_4BU8_to_U8(srcData, srcStride, srcOffset, dst);
  			} else {
  				throw new RuntimeException("Unexpected number of bands found. Bands = " + numBands);
  			}
  		}
  	}
docs: A faster convert that works directly with a specific raster