@jimp/plugin-color
Advanced tools
Comparing version 0.22.7 to 0.22.8
@@ -0,1 +1,13 @@ | ||
# v0.22.8 (Thu May 11 2023) | ||
#### 🚀 Enhancement | ||
- Fix: convolute not defaulting to 0, 0 as starting point [#1228](https://github.com/jimp-dev/jimp/pull/1228) ([@sjoerd108](https://github.com/sjoerd108)) | ||
#### Authors: 1 | ||
- Sjoerd ([@sjoerd108](https://github.com/sjoerd108)) | ||
--- | ||
# v0.22.6 (Fri Feb 24 2023) | ||
@@ -2,0 +14,0 @@ |
@@ -436,3 +436,3 @@ "use strict"; | ||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete | ||
* @returns {Jimp }this for chaining of methods | ||
* @returns {Jimp} this for chaining of methods | ||
*/ | ||
@@ -461,5 +461,4 @@ convolute(kernel, x, y, w, h, cb) { | ||
} | ||
const ksize = (kernel.length - 1) / 2; | ||
x = isDef(x) ? x : ksize; | ||
y = isDef(y) ? y : ksize; | ||
x = isDef(x) ? x : 0; | ||
y = isDef(y) ? y : 0; | ||
w = isDef(w) ? w : this.bitmap.width - x; | ||
@@ -466,0 +465,0 @@ h = isDef(h) ? h : this.bitmap.height - y; |
@@ -428,3 +428,3 @@ import tinyColor from "tinycolor2"; | ||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete | ||
* @returns {Jimp }this for chaining of methods | ||
* @returns {Jimp} this for chaining of methods | ||
*/ | ||
@@ -453,5 +453,4 @@ convolute(kernel, x, y, w, h, cb) { | ||
} | ||
const ksize = (kernel.length - 1) / 2; | ||
x = isDef(x) ? x : ksize; | ||
y = isDef(y) ? y : ksize; | ||
x = isDef(x) ? x : 0; | ||
y = isDef(y) ? y : 0; | ||
w = isDef(w) ? w : this.bitmap.width - x; | ||
@@ -458,0 +457,0 @@ h = isDef(h) ? h : this.bitmap.height - y; |
{ | ||
"name": "@jimp/plugin-color", | ||
"version": "0.22.7", | ||
"version": "0.22.8", | ||
"description": "Bitmap manipulation to adjust the color in an image.", | ||
@@ -24,9 +24,9 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@jimp/utils": "^0.22.7", | ||
"@jimp/utils": "^0.22.8", | ||
"tinycolor2": "^1.6.0" | ||
}, | ||
"devDependencies": { | ||
"@jimp/custom": "^0.22.7", | ||
"@jimp/test-utils": "^0.22.7", | ||
"@jimp/types": "^0.22.7" | ||
"@jimp/custom": "^0.22.8", | ||
"@jimp/test-utils": "^0.22.8", | ||
"@jimp/types": "^0.22.8" | ||
}, | ||
@@ -39,3 +39,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "965a14e14d6e2acf81ddf78c30b4c85d921ea7db" | ||
"gitHead": "a5b93f822d63ffc0d20cb67adf03b1322e6a8f1b" | ||
} |
@@ -586,3 +586,3 @@ import tinyColor from "tinycolor2"; | ||
* @param {function(Error, Jimp)} cb (optional) a callback for when complete | ||
* @returns {Jimp }this for chaining of methods | ||
* @returns {Jimp} this for chaining of methods | ||
*/ | ||
@@ -617,6 +617,4 @@ convolute(kernel, x, y, w, h, cb) { | ||
const ksize = (kernel.length - 1) / 2; | ||
x = isDef(x) ? x : ksize; | ||
y = isDef(y) ? y : ksize; | ||
x = isDef(x) ? x : 0; | ||
y = isDef(y) ? y : 0; | ||
w = isDef(w) ? w : this.bitmap.width - x; | ||
@@ -623,0 +621,0 @@ h = isDef(h) ? h : this.bitmap.height - y; |
@@ -60,2 +60,8 @@ import { Jimp, mkJGD, getTestDir } from "@jimp/test-utils"; | ||
const blurM = [ | ||
[1 / 9, 1 / 9, 1 / 9], | ||
[1 / 9, 1 / 9, 1 / 9], | ||
[1 / 9, 1 / 9, 1 / 9], | ||
]; | ||
it("3x3 sharp matrix on EDGE_EXTEND", (done) => { | ||
@@ -154,2 +160,12 @@ expectToBeJGD( | ||
it("3x3 box blur matrix using convolute", async () => { | ||
const expectedImg = await jimp.read( | ||
getTestDir(__dirname) + "/images/tiles-blurred.png" | ||
); | ||
const image = await jimp.read(getTestDir(__dirname) + "/images/tiles.jpg"); | ||
expect(image.convolute(blurM).bitmap.data).toEqual(expectedImg.bitmap.data); | ||
}); | ||
it("new pixel value is greater than 255", async () => { | ||
@@ -156,0 +172,0 @@ const expectedImg = await jimp.read( |
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
425764
16
1764
Updated@jimp/utils@^0.22.8