Add experimental sharpness calc to stats #2251

This commit is contained in:
Lovell Fuller
2020-06-12 11:25:57 +01:00
parent 9431029917
commit 8f5495a446
6 changed files with 49 additions and 2 deletions

View File

@@ -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

View File

@@ -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.