Doc update and changelog entry for #3461

This commit is contained in:
Lovell Fuller
2023-04-07 11:21:15 +01:00
parent a4c6eba7d4
commit e87204b92c
6 changed files with 47 additions and 17 deletions

View File

@@ -265,6 +265,31 @@ await sharp(rgbaInput)
```
## unflatten
Ensure the image has an alpha channel
with all white pixel values made fully transparent.
Existing alpha channel values for non-white pixels remain unchanged.
This feature is experimental and the API may change.
**Since**: 0.32.1
**Example**
```js
await sharp(rgbInput)
.unflatten()
.toBuffer();
```
**Example**
```js
await sharp(rgbInput)
.threshold(128, { grayscale: false }) // converter bright pixels to white
.unflatten()
.toBuffer();
```
## gamma
Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of `1/gamma`
then increasing the encoding (brighten) post-resize at a factor of `gamma`.

View File

@@ -6,6 +6,10 @@ Requires libvips v8.14.2
### v0.32.1 - TBD
* Add experimental `unflatten` operation.
[#3461](https://github.com/lovell/sharp/pull/3461)
[@antonmarsden](https://github.com/antonmarsden)
* Ensure use of `flip` operation forces random access read (regression in 0.32.0).
[#3600](https://github.com/lovell/sharp/issues/3600)

File diff suppressed because one or more lines are too long