mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 15:25:07 +01:00
Add experimental sharpness calc to stats #2251
This commit is contained in:
@@ -71,6 +71,7 @@ A `Promise` is returned when `callback` is not provided.
|
||||
- `maxY` (y-coordinate of one of the pixel where the maximum lies)
|
||||
- `isOpaque`: Is the image fully opaque? Will be `true` if the image has no alpha channel or if every pixel is fully opaque.
|
||||
- `entropy`: Histogram-based estimation of greyscale entropy, discarding alpha channel if any (experimental)
|
||||
- `sharpness`: Estimation of greyscale sharpness based on the standard deviation of a Laplacian convolution, discarding alpha channel if any (experimental)
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -87,6 +88,10 @@ image
|
||||
});
|
||||
```
|
||||
|
||||
```javascript
|
||||
const { entropy, sharpness } = await sharp(input).stats();
|
||||
```
|
||||
|
||||
Returns **[Promise][5]<[Object][6]>**
|
||||
|
||||
[1]: https://libvips.github.io/libvips/API/current/VipsImage.html#VipsInterpretation
|
||||
|
||||
@@ -21,6 +21,9 @@ Requires libvips v8.9.1
|
||||
* Add support for named `alpha` channel to `extractChannel` operation.
|
||||
[#2138](https://github.com/lovell/sharp/issues/2138)
|
||||
|
||||
* Add experimental `sharpness` calculation to `stats()` response.
|
||||
[#2251](https://github.com/lovell/sharp/issues/2251)
|
||||
|
||||
### v0.25.3 - 17th May 2020
|
||||
|
||||
* Ensure libvips is initialised only once, improves worker thread safety.
|
||||
|
||||
Reference in New Issue
Block a user