mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add removeAlpha op, removes alpha channel if any #1248
This commit is contained in:
@@ -1,5 +1,21 @@
|
||||
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
||||
|
||||
## removeAlpha
|
||||
|
||||
Remove alpha channel, if any. This is a no-op if the image does not have an alpha channel.
|
||||
|
||||
### Examples
|
||||
|
||||
```javascript
|
||||
sharp('rgba.png')
|
||||
.removeAlpha()
|
||||
.toFile('rgb.png', function(err, info) {
|
||||
// rgb.png is a 3 channel image without an alpha channel
|
||||
});
|
||||
```
|
||||
|
||||
Returns **Sharp**
|
||||
|
||||
## extractChannel
|
||||
|
||||
Extract a single channel from a multi-channel image.
|
||||
|
||||
@@ -79,6 +79,7 @@ A Promise is returned when `callback` is not provided.
|
||||
- `maxX` (x-coordinate of one of the pixel where the maximum lies)
|
||||
- `maxY` (y-coordinate of one of the pixel where the maximum lies)
|
||||
- `isOpaque`: Value to identify if the image is opaque or transparent, based on the presence and use of alpha channel
|
||||
- `entropy`: Histogram-based estimation of greyscale entropy, discarding alpha channel if any (experimental)
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ Requires libvips v8.6.1.
|
||||
|
||||
#### v0.20.6 - TBD
|
||||
|
||||
* Add removeAlpha operation to remove alpha channel, if any.
|
||||
[#1248](https://github.com/lovell/sharp/issues/1248)
|
||||
|
||||
* Expose mozjpeg quant_table flag.
|
||||
[#1285](https://github.com/lovell/sharp/pull/1285)
|
||||
[@rexxars](https://github.com/rexxars)
|
||||
|
||||
Reference in New Issue
Block a user