function flatten (options) {
  this.options.flatten = is.bool(options) ? options : true;
  if (is.object(options)) {
    this._setBackgroundColourOption('flattenBackground', options.background);
  }
  return this;
}
Merge alpha transparency channel, if any, with a background, then remove the alpha channel.

See also {@link /api-channel#removealpha|removeAlpha}.

@example
await sharp(rgbaInput)
  .flatten({ background: '#F0A703' })
  .toBuffer();

@param {Object} [options]
@param {string|Object} [options.background={r: 0, g: 0, b: 0}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black.
@returns {Sharp}