mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Doc update and changelog entry for #3461
This commit is contained in:
@@ -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`.
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user