code: public static BufferedImage checkInputs(ImageBase src, BufferedImage dst) {
  		if (dst != null) {
  			if (dst.getWidth() != src.getWidth() || dst.getHeight() != src.getHeight()) {
  				throw new IllegalArgumentException("Shapes do not match: "+
  						"src = ( "+src.width+" , "+src.height+" )  " +
  						"dst = ( "+dst.getWidth()+" , "+dst.getHeight()+" )");
  			}
  		} else {
  			if(src instanceof GrayI8)
  				dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_BYTE_GRAY);
  			else if(src instanceof GrayF)
  				// no good equivalent.  Just assume the image is a regular gray scale image
  				// with pixel values from 0 to 255
  				dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_BYTE_GRAY);
  //			throw new RuntimeException("Fail!");
  			else if(src instanceof GrayI)
  				// no good equivalent.  I'm giving it the biggest pixel for the range
  				dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_USHORT_GRAY);
  			else
  				dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB);
  		}
  		return dst;
  	}
docs: If null the dst is declared, otherwise it checks to see if the 'dst' as the same shape as 'src'.