lib/resize.js
function trim (threshold) {
  if (!is.defined(threshold)) {
    this.options.trimThreshold = 10;
  } else if (is.number(threshold) && threshold > 0) {
    this.options.trimThreshold = threshold;
  } else {
    throw is.invalidParameterError('threshold', 'number greater than zero', threshold);
  }
  return this;
}
function trim (threshold) {
  if (!is.defined(threshold)) {
    this.options.trimThreshold = 10;
  } else if (is.number(threshold) && threshold > 0) {
    this.options.trimThreshold = threshold;
  } else {
    throw is.invalidParameterError('threshold', 'number greater than zero', threshold);
  }
  return this;
}
function trim ( threshold ) { if ( ! is . defined ( threshold ) ) { this . options . trimThreshold = 10 ; } else if ( is . number ( threshold ) && threshold > 0 ) { this . options . trimThreshold = threshold ; } else { throw is . invalidParameterError ( 'threshold' , 'number greater than zero' , threshold ) ; } return this ; }
Trim "boring" pixels from all edges that contain values similar to the top-left pixel.
The `info` response Object will contain `trimOffsetLeft` and `trimOffsetTop` properties.
@param {Number} [threshold=10] the allowed difference from the top-left pixel, a number greater than zero.
@returns {Sharp}
@throws {Error} Invalid parameters
Trim boring pixels from all edges that contain values similar to the top - left pixel . The info response Object will contain trimOffsetLeft and trimOffsetTop properties .