Comparing version 0.28.2 to 0.28.3
@@ -46,3 +46,2 @@ 'use strict'; | ||
} | ||
libvips.log('Attempting to build from source via node-gyp but this may fail due to the above error'); | ||
libvips.log('Please see https://sharp.pixelplumbing.com/install for required dependencies'); | ||
@@ -49,0 +48,0 @@ process.exit(1); |
@@ -18,2 +18,4 @@ 'use strict'; | ||
* | ||
* See also {@link /api-operation#flatten|flatten}. | ||
* | ||
* @example | ||
@@ -20,0 +22,0 @@ * sharp('rgba.png') |
@@ -92,2 +92,4 @@ 'use strict'; | ||
* @param {Number} [images[].raw.channels] | ||
* @param {boolean} [images[].failOnError=true] - @see {@link /api-constructor#parameters|constructor parameters} | ||
* @param {number|boolean} [images[].limitInputPixels=268402689] - @see {@link /api-constructor#parameters|constructor parameters} | ||
* @returns {Sharp} | ||
@@ -94,0 +96,0 @@ * @throws {Error} Invalid parameters |
@@ -219,2 +219,5 @@ 'use strict'; | ||
normalise: false, | ||
claheWidth: 0, | ||
claheHeight: 0, | ||
claheMaxSlope: 3, | ||
brightness: 1, | ||
@@ -221,0 +224,0 @@ saturation: 1, |
@@ -273,5 +273,7 @@ 'use strict'; | ||
* | ||
* See also {@link /api-channel#removealpha|removeAlpha}. | ||
* | ||
* @example | ||
* await sharp(rgbaInput) | ||
* .flatten({background: '#F0A703' }) | ||
* .flatten({ background: '#F0A703' }) | ||
* .toBuffer(); | ||
@@ -355,2 +357,43 @@ * | ||
/** | ||
* Perform contrast limiting adaptive histogram equalization | ||
* {@link https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE|CLAHE}. | ||
* | ||
* This will, in general, enhance the clarity of the image by bringing out darker details. | ||
* | ||
* @since 0.28.3 | ||
* | ||
* @param {Object} options | ||
* @param {number} options.width - integer width of the region in pixels. | ||
* @param {number} options.height - integer height of the region in pixels. | ||
* @param {number} [options.maxSlope=3] - maximum value for the slope of the | ||
* cumulative histogram. A value of 0 disables contrast limiting. Valid values | ||
* are integers in the range 0-100 (inclusive) | ||
* @returns {Sharp} | ||
* @throws {Error} Invalid parameters | ||
*/ | ||
function clahe (options) { | ||
if (!is.plainObject(options)) { | ||
throw is.invalidParameterError('options', 'plain object', options); | ||
} | ||
if (!('width' in options) || !is.integer(options.width) || options.width <= 0) { | ||
throw is.invalidParameterError('width', 'integer above zero', options.width); | ||
} else { | ||
this.options.claheWidth = options.width; | ||
} | ||
if (!('height' in options) || !is.integer(options.height) || options.height <= 0) { | ||
throw is.invalidParameterError('height', 'integer above zero', options.height); | ||
} else { | ||
this.options.claheHeight = options.height; | ||
} | ||
if (!is.defined(options.maxSlope)) { | ||
this.options.claheMaxSlope = 3; | ||
} else if (!is.integer(options.maxSlope) || options.maxSlope < 0 || options.maxSlope > 100) { | ||
throw is.invalidParameterError('maxSlope', 'integer 0-100', options.maxSlope); | ||
} else { | ||
this.options.claheMaxSlope = options.maxSlope; | ||
} | ||
return this; | ||
} | ||
/** | ||
* Convolve the image with the specified kernel. | ||
@@ -373,3 +416,3 @@ * | ||
* @param {number} kernel.width - width of the kernel in pixels. | ||
* @param {number} kernel.height - width of the kernel in pixels. | ||
* @param {number} kernel.height - height of the kernel in pixels. | ||
* @param {Array<number>} kernel.kernel - Array of length `width*height` containing the kernel values. | ||
@@ -600,2 +643,3 @@ * @param {number} [kernel.scale=sum] - the scale of the kernel in pixels. | ||
normalize, | ||
clahe, | ||
convolve, | ||
@@ -602,0 +646,0 @@ threshold, |
{ | ||
"name": "sharp", | ||
"description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images", | ||
"version": "0.28.2", | ||
"version": "0.28.3", | ||
"author": "Lovell Fuller <npm@lovell.info>", | ||
@@ -79,6 +79,7 @@ "homepage": "https://github.com/lovell/sharp", | ||
"Jacob Smith <jacob@frende.me>", | ||
"Michael Nutt <michael@nutt.im>" | ||
"Michael Nutt <michael@nutt.im>", | ||
"Brad Parham <baparham@gmail.com>" | ||
], | ||
"scripts": { | ||
"install": "(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)", | ||
"install": "(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)", | ||
"clean": "rm -rf node_modules/ build/ vendor/ .nyc_output/ coverage/ test/fixtures/output.*", | ||
@@ -126,3 +127,3 @@ "test": "npm run test-lint && npm run test-unit && npm run test-licensing", | ||
"detect-libc": "^1.0.3", | ||
"node-addon-api": "^3.1.0", | ||
"node-addon-api": "^3.2.0", | ||
"prebuild-install": "^6.1.2", | ||
@@ -129,0 +130,0 @@ "semver": "^7.3.5", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
445420
39
4001
Updatednode-addon-api@^3.2.0