code: public static <T extends ImageBase<T>> void boundImage(T input , double min , double max ) {
  		if( input instanceof ImageGray ) {
  			if (GrayU8.class == input.getClass()) {
  				PixelMath.boundImage((GrayU8) input, (int) min, (int) max);
  			} else if (GrayS8.class == input.getClass()) {
  				PixelMath.boundImage((GrayS8) input, (int) min, (int) max);
  			} else if (GrayU16.class == input.getClass()) {
  				PixelMath.boundImage((GrayU16) input, (int) min, (int) max);
  			} else if (GrayS16.class == input.getClass()) {
  				PixelMath.boundImage((GrayS16) input, (int) min, (int) max);
  			} else if (GrayS32.class == input.getClass()) {
  				PixelMath.boundImage((GrayS32) input, (int) min, (int) max);
  			} else if (GrayS64.class == input.getClass()) {
  				PixelMath.boundImage((GrayS64) input, (long) min, (long) max);
  			} else if (GrayF32.class == input.getClass()) {
  				PixelMath.boundImage((GrayF32) input, (float) min, (float) max);
  			} else if (GrayF64.class == input.getClass()) {
  				PixelMath.boundImage((GrayF64) input, min, max);
  			} else {
  				throw new IllegalArgumentException("Unknown image Type: " + input.getClass().getSimpleName());
  			}
  		} else if( input instanceof Planar ) {
  			Planar in = (Planar)input;
  
  			for (int i = 0; i < in.getNumBands(); i++) {
  				boundImage( in.getBand(i), min, max);
  			}
  		}
  	}
docs: Bounds image pixels to be between these two values.
  
  @param input Input image.
  @param min minimum value. Inclusive.
  @param max maximum value. Inclusive.