lib/operation.js
function boolean (operand, operator, options) {
  this.options.boolean = this._createInputDescriptor(operand, options);
  if (is.string(operator) && is.inArray(operator, ['and', 'or', 'eor'])) {
    this.options.booleanOp = operator;
  } else {
    throw new Error('Invalid boolean operator ' + operator);
  }
  return this;
}
function boolean (operand, operator, options) {
  this.options.boolean = this._createInputDescriptor(operand, options);
  if (is.string(operator) && is.inArray(operator, ['and', 'or', 'eor'])) {
    this.options.booleanOp = operator;
  } else {
    throw new Error('Invalid boolean operator ' + operator);
  }
  return this;
}
function boolean ( operand , operator , options ) { this . options . boolean = this . _createInputDescriptor ( operand , options ) ; if ( is . string ( operator ) && is . inArray ( operator , [ 'and' , 'or' , 'eor' ] ) ) { this . options . booleanOp = operator ; } else { throw new Error ( 'Invalid boolean operator ' + operator ) ; } return this ; }
Perform a bitwise boolean operation with operand image.

This operation creates an output image where each pixel is the result of
the selected bitwise boolean `operation` between the corresponding pixels of the input images.

@param {Buffer|String} operand - Buffer containing image data or String containing the path to an image file.
@param {String} operator - one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively.
@param {Object} [options]
@param {Object} [options.raw] - describes operand when using raw pixel data.
@param {Number} [options.raw.width]
@param {Number} [options.raw.height]
@param {Number} [options.raw.channels]
@returns {Sharp}
@throws {Error} Invalid parameters
Perform a bitwise boolean operation with operand image .