Skip to content

Commit

Permalink
Docs: clarify that flatten removes alpha channel #2601
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Mar 25, 2021
1 parent 9fc611f commit f1f18fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 9 additions & 1 deletion docs/api-operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,21 @@ Returns **Sharp**

## flatten

Merge alpha transparency channel, if any, with a background.
Merge alpha transparency channel, if any, with a background, then remove the alpha channel.

### Parameters

- `options` **[Object][2]?**
- `options.background` **([string][3] \| [Object][2])** background colour, parsed by the [color][4] module, defaults to black. (optional, default `{r:0,g:0,b:0}`)

### Examples

```javascript
await sharp(rgbaInput)
.flatten('#F0A703')
.toBuffer();
```

Returns **Sharp**

## gamma
Expand Down

0 comments on commit f1f18fb

Please sign in to comment.