mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Docs: ensure alpha attribute is used for transparency
This commit is contained in:
@@ -169,7 +169,7 @@ This operation will always occur after resizing and extraction, if any.
|
||||
// to the top, left and right edges and 20 to the bottom edge
|
||||
sharp(input)
|
||||
.resize(140)
|
||||
.background({r: 0, g: 0, b: 0, a: 0})
|
||||
.background({r: 0, g: 0, b: 0, alpha: 0})
|
||||
.extend({top: 10, bottom: 20, left: 10, right: 10})
|
||||
...
|
||||
```
|
||||
|
||||
@@ -110,7 +110,7 @@ contain an alpha channel, even when the input image does not.
|
||||
```javascript
|
||||
sharp('input.gif')
|
||||
.resize(200, 300)
|
||||
.background({r: 0, g: 0, b: 0, a: 0})
|
||||
.background({r: 0, g: 0, b: 0, alpha: 0})
|
||||
.embed()
|
||||
.toFormat(sharp.format.webp)
|
||||
.toBuffer(function(err, outputBuffer) {
|
||||
|
||||
Reference in New Issue
Block a user