Docs: clarify that flatten removes alpha channel #2601

This commit is contained in:
Lovell Fuller
2021-03-25 14:38:55 +00:00
parent 9fc611f257
commit f1f18fbb4a
3 changed files with 17 additions and 3 deletions

View File

@@ -268,7 +268,13 @@ function blur (sigma) {
}
/**
* Merge alpha transparency channel, if any, with a background.
* Merge alpha transparency channel, if any, with a background, then remove the alpha channel.
*
* @example
* await sharp(rgbaInput)
* .flatten('#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}