mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add experimental sharpness calc to stats #2251
This commit is contained in:
@@ -299,6 +299,7 @@ function metadata (callback) {
|
||||
* - `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)
|
||||
*
|
||||
* @example
|
||||
* const image = sharp(inputJpg);
|
||||
@@ -308,6 +309,9 @@ function metadata (callback) {
|
||||
* // stats contains the channel-wise statistics array and the isOpaque value
|
||||
* });
|
||||
*
|
||||
* @example
|
||||
* const { entropy, sharpness } = await sharp(input).stats();
|
||||
*
|
||||
* @param {Function} [callback] - called with the arguments `(err, stats)`
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user