@jimp/plugin-gaussian
Advanced tools
Comparing version 0.16.3-canary.1125.1580.0 to 0.16.3
@@ -0,1 +1,13 @@ | ||
# v0.16.3 (Sat Feb 04 2023) | ||
#### ⚠️ Pushed to `master` | ||
- upgrade prettier ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
#### Authors: 1 | ||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
--- | ||
# v0.11.0 (Fri May 15 2020) | ||
@@ -15,3 +27,3 @@ | ||
#### 🐛 Bug Fix | ||
#### 🐛 Bug Fix | ||
@@ -24,2 +36,2 @@ - `@jimp/cli`, `@jimp/core`, `@jimp/custom`, `jimp`, `@jimp/plugin-blit`, `@jimp/plugin-blur`, `@jimp/plugin-circle`, `@jimp/plugin-color`, `@jimp/plugin-contain`, `@jimp/plugin-cover`, `@jimp/plugin-crop`, `@jimp/plugin-displace`, `@jimp/plugin-dither`, `@jimp/plugin-fisheye`, `@jimp/plugin-flip`, `@jimp/plugin-gaussian`, `@jimp/plugin-invert`, `@jimp/plugin-mask`, `@jimp/plugin-normalize`, `@jimp/plugin-print`, `@jimp/plugin-resize`, `@jimp/plugin-rotate`, `@jimp/plugin-scale`, `@jimp/plugin-shadow`, `@jimp/plugin-threshold`, `@jimp/plugins`, `@jimp/test-utils`, `@jimp/bmp`, `@jimp/gif`, `@jimp/jpeg`, `@jimp/png`, `@jimp/tiff`, `@jimp/types`, `@jimp/utils` | ||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
- Corbin Crutchley ([@crutchcorn](https://github.com/crutchcorn)) | ||
- Corbin Crutchley ([@crutchcorn](https://github.com/crutchcorn)) |
@@ -20,8 +20,8 @@ "use strict"; | ||
// http://blog.ivank.net/fastest-gaussian-blur.html | ||
if (typeof r !== 'number') { | ||
return _utils.throwError.call(this, 'r must be a number', cb); | ||
if (typeof r !== "number") { | ||
return _utils.throwError.call(this, "r must be a number", cb); | ||
} | ||
if (r < 1) { | ||
return _utils.throwError.call(this, 'r must be greater than 0', cb); | ||
return _utils.throwError.call(this, "r must be greater than 0", cb); | ||
} | ||
@@ -28,0 +28,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { ImageCallback } from '@jimp/core'; | ||
import { ImageCallback } from "@jimp/core"; | ||
@@ -7,2 +7,2 @@ interface Gaussian { | ||
export default function(): Gaussian; | ||
export default function (): Gaussian; |
{ | ||
"name": "@jimp/plugin-gaussian", | ||
"version": "0.16.3-canary.1125.1580.0", | ||
"version": "0.16.3", | ||
"description": "gaussian blur an image.", | ||
@@ -21,3 +21,3 @@ "main": "dist/index.js", | ||
"@babel/runtime": "^7.7.2", | ||
"@jimp/utils": "0.16.3-canary.1125.1580.0" | ||
"@jimp/utils": "^0.16.3" | ||
}, | ||
@@ -30,3 +30,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "bfdb98aaf820272c06e332483b943d0ac58659db" | ||
"gitHead": "b9ac83d855d09deecde129a9c9b5b328ba7ea5b2" | ||
} |
@@ -16,6 +16,6 @@ <div align="center"> | ||
```js | ||
import jimp from 'jimp'; | ||
import jimp from "jimp"; | ||
async function main() { | ||
const image = await jimp.read('test/image.png'); | ||
const image = await jimp.read("test/image.png"); | ||
@@ -22,0 +22,0 @@ image.gaussian(15); |
@@ -1,2 +0,2 @@ | ||
import { isNodePattern, throwError } from '@jimp/utils'; | ||
import { isNodePattern, throwError } from "@jimp/utils"; | ||
@@ -12,8 +12,8 @@ /** | ||
// http://blog.ivank.net/fastest-gaussian-blur.html | ||
if (typeof r !== 'number') { | ||
return throwError.call(this, 'r must be a number', cb); | ||
if (typeof r !== "number") { | ||
return throwError.call(this, "r must be a number", cb); | ||
} | ||
if (r < 1) { | ||
return throwError.call(this, 'r must be greater than 0', cb); | ||
return throwError.call(this, "r must be greater than 0", cb); | ||
} | ||
@@ -31,3 +31,3 @@ | ||
for (let x = 0; x < range; x++) { | ||
const dsq = (x - rs) ** 2 + (y - rs) ** 2 ; | ||
const dsq = (x - rs) ** 2 + (y - rs) ** 2; | ||
weights[y][x] = Math.exp(-dsq / rr2) / rr2pi; | ||
@@ -47,4 +47,10 @@ } | ||
for (let ix = 0; ix < range; ix++) { | ||
const x1 = Math.min(this.bitmap.width - 1, Math.max(0, ix + x - rs )); | ||
const y1 = Math.min(this.bitmap.height - 1, Math.max(0, iy + y - rs)); | ||
const x1 = Math.min( | ||
this.bitmap.width - 1, | ||
Math.max(0, ix + x - rs) | ||
); | ||
const y1 = Math.min( | ||
this.bitmap.height - 1, | ||
Math.max(0, iy + y - rs) | ||
); | ||
const weight = weights[iy][ix]; | ||
@@ -75,3 +81,3 @@ const idx = (y1 * this.bitmap.width + x1) << 2; | ||
return this; | ||
} | ||
}, | ||
}); |
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
15107
8
142
+ Added@jimp/utils@0.16.13(transitive)
- Removed@jimp/utils@0.16.3-canary.1125.1580.0(transitive)
Updated@jimp/utils@^0.16.3