mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Docs: changelog and credit for #3556
This commit is contained in:
@@ -146,7 +146,8 @@ const scaleByHalf = await sharp(input)
|
||||
|
||||
|
||||
## extend
|
||||
Extends/pads the edges of the image with the provided background colour.
|
||||
Extend / pad / extrude one or more edges of the image with either
|
||||
the provided background colour or pixels derived from the image.
|
||||
This operation will always occur after resizing and extraction, if any.
|
||||
|
||||
|
||||
@@ -162,6 +163,7 @@ This operation will always occur after resizing and extraction, if any.
|
||||
| [extend.left] | <code>number</code> | <code>0</code> | |
|
||||
| [extend.bottom] | <code>number</code> | <code>0</code> | |
|
||||
| [extend.right] | <code>number</code> | <code>0</code> | |
|
||||
| [extend.extendWith] | <code>String</code> | <code>'background'</code> | populate new pixels using this method, one of: background, copy, repeat, mirror. |
|
||||
| [extend.background] | <code>String</code> \| <code>Object</code> | <code>{r: 0, g: 0, b: 0, alpha: 1}</code> | background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black without transparency. |
|
||||
|
||||
**Example**
|
||||
@@ -189,6 +191,16 @@ sharp(input)
|
||||
})
|
||||
...
|
||||
```
|
||||
**Example**
|
||||
```js
|
||||
// Extrude image by 8 pixels to the right, mirroring existing right hand edge
|
||||
sharp(input)
|
||||
.extend({
|
||||
right: 8,
|
||||
background: 'mirror'
|
||||
})
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
## extract
|
||||
|
||||
@@ -49,6 +49,10 @@ Requires libvips v8.14.0
|
||||
[#3548](https://github.com/lovell/sharp/pull/3548)
|
||||
[@kapouer](https://github.com/kapouer)
|
||||
|
||||
* Add support to `extend` operation for `extendWith` to allow copy/mirror/repeat.
|
||||
[#3556](https://github.com/lovell/sharp/pull/3556)
|
||||
[@janaz](https://github.com/janaz)
|
||||
|
||||
## v0.31 - *eagle*
|
||||
|
||||
Requires libvips v8.13.3
|
||||
|
||||
@@ -266,3 +266,6 @@ GitHub: https://github.com/marcosc90
|
||||
|
||||
Name: Emanuel Jöbstl
|
||||
GitHub: https://github.com/ejoebstl
|
||||
|
||||
Name: Tomasz Janowski
|
||||
GitHub: https://github.com/janaz
|
||||
|
||||
Reference in New Issue
Block a user