mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Docs: ensure alpha attribute is used for transparency
This commit is contained in:
parent
c6a28db8b1
commit
473055468a
@ -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
|
// to the top, left and right edges and 20 to the bottom edge
|
||||||
sharp(input)
|
sharp(input)
|
||||||
.resize(140)
|
.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})
|
.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
|
```javascript
|
||||||
sharp('input.gif')
|
sharp('input.gif')
|
||||||
.resize(200, 300)
|
.resize(200, 300)
|
||||||
.background({r: 0, g: 0, b: 0, a: 0})
|
.background({r: 0, g: 0, b: 0, alpha: 0})
|
||||||
.embed()
|
.embed()
|
||||||
.toFormat(sharp.format.webp)
|
.toFormat(sharp.format.webp)
|
||||||
.toBuffer(function(err, outputBuffer) {
|
.toBuffer(function(err, outputBuffer) {
|
||||||
|
@ -200,7 +200,7 @@ const crop = function crop (crop) {
|
|||||||
* @example
|
* @example
|
||||||
* sharp('input.gif')
|
* sharp('input.gif')
|
||||||
* .resize(200, 300)
|
* .resize(200, 300)
|
||||||
* .background({r: 0, g: 0, b: 0, a: 0})
|
* .background({r: 0, g: 0, b: 0, alpha: 0})
|
||||||
* .embed()
|
* .embed()
|
||||||
* .toFormat(sharp.format.webp)
|
* .toFormat(sharp.format.webp)
|
||||||
* .toBuffer(function(err, outputBuffer) {
|
* .toBuffer(function(err, outputBuffer) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user