Socket
Socket
Sign inDemoInstall

@jimp/plugin-color

Package Overview
Dependencies
Maintainers
2
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jimp/plugin-color - npm Package Compare versions

Comparing version 0.22.7 to 0.22.8

test/images/tiles-blurred.png

12

CHANGELOG.md

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

7

dist/index.js

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc