@jimp/plugin-color
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -0,1 +1,17 @@ | ||
# v1.0.3 (Sat Aug 31 2024) | ||
#### 🐛 Bug Fix | ||
- Fix build [#1303](https://github.com/jimp-dev/jimp/pull/1303) ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
#### ⚠️ Pushed to `main` | ||
- add clean script ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
#### Authors: 1 | ||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
--- | ||
# v1.0.2 (Sat Aug 31 2024) | ||
@@ -2,0 +18,0 @@ |
@@ -529,3 +529,3 @@ import { Edge, JimpClass } from "@jimp/types"; | ||
*/ | ||
invert<I_1 extends JimpClass>(image: I_1): I_1; | ||
invert<I extends JimpClass>(image: I): I; | ||
/** | ||
@@ -543,3 +543,3 @@ * Adjusts the brightness of the image | ||
*/ | ||
brightness<I_2 extends JimpClass>(image: I_2, val: number): I_2; | ||
brightness<I extends JimpClass>(image: I, val: number): I; | ||
/** | ||
@@ -557,3 +557,3 @@ * Adjusts the contrast of the image | ||
*/ | ||
contrast<I_3 extends JimpClass>(image: I_3, val: number): I_3; | ||
contrast<I extends JimpClass>(image: I, val: number): I; | ||
/** | ||
@@ -571,3 +571,3 @@ * Apply a posterize effect | ||
*/ | ||
posterize<I_4 extends JimpClass>(image: I_4, n: number): I_4; | ||
posterize<I extends JimpClass>(image: I, n: number): I; | ||
/** | ||
@@ -584,3 +584,3 @@ * Removes colour from the image using ITU Rec 709 luminance values | ||
*/ | ||
greyscale<I_5 extends JimpClass>(image: I_5): I_5; | ||
greyscale<I extends JimpClass>(image: I): I; | ||
/** | ||
@@ -598,3 +598,3 @@ * Multiplies the opacity of each pixel by a factor between 0 and 1 | ||
*/ | ||
opacity<I_6 extends JimpClass>(image: I_6, f: number): I_6; | ||
opacity<I extends JimpClass>(image: I, f: number): I; | ||
/** | ||
@@ -611,3 +611,3 @@ * Applies a sepia tone to the image. | ||
*/ | ||
sepia<I_7 extends JimpClass>(image: I_7): I_7; | ||
sepia<I extends JimpClass>(image: I): I; | ||
/** | ||
@@ -625,3 +625,3 @@ * Fades each pixel by a factor between 0 and 1 | ||
*/ | ||
fade<I_8 extends JimpClass>(image: I_8, f: number): I_8; | ||
fade<I extends JimpClass>(image: I, f: number): I; | ||
/** | ||
@@ -642,3 +642,3 @@ * Adds each element of the image to its local neighbors, weighted by the kernel | ||
*/ | ||
convolution<I_9 extends JimpClass>(image: I_9, options: ConvolutionOptions): I_9; | ||
convolution<I extends JimpClass>(image: I, options: ConvolutionOptions): I; | ||
/** | ||
@@ -655,3 +655,3 @@ * Set the alpha channel on every pixel to fully opaque. | ||
*/ | ||
opaque<I_10 extends JimpClass>(image: I_10): I_10; | ||
opaque<I extends JimpClass>(image: I): I; | ||
/** | ||
@@ -672,3 +672,3 @@ * Pixelates the image or a region | ||
*/ | ||
pixelate<I_11 extends JimpClass>(image: I_11, options: PixelateOptions): I_11; | ||
pixelate<I extends JimpClass>(image: I, options: PixelateOptions): I; | ||
/** | ||
@@ -697,3 +697,3 @@ * Applies a convolution kernel to the image or a region | ||
*/ | ||
convolute<I_12 extends JimpClass>(image: I_12, options: ConvoluteOptions): I_12; | ||
convolute<I extends JimpClass>(image: I, options: ConvoluteOptions): I; | ||
/** | ||
@@ -715,5 +715,5 @@ * Apply multiple color modification rules | ||
*/ | ||
color<I_13 extends JimpClass>(image: I_13, actions: ColorAction[]): I_13; | ||
color<I extends JimpClass>(image: I, actions: ColorAction[]): I; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -290,4 +290,6 @@ "use strict"; | ||
image.bitmap.data[idx] += (255 - image.bitmap.data[idx]) * val; | ||
image.bitmap.data[idx + 1] += (255 - image.bitmap.data[idx + 1]) * val; | ||
image.bitmap.data[idx + 2] += (255 - image.bitmap.data[idx + 2]) * val; | ||
image.bitmap.data[idx + 1] += | ||
(255 - image.bitmap.data[idx + 1]) * val; | ||
image.bitmap.data[idx + 2] += | ||
(255 - image.bitmap.data[idx + 2]) * val; | ||
} | ||
@@ -294,0 +296,0 @@ }); |
{ | ||
"type": "commonjs", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"sideEffects": false | ||
} | ||
"type": "commonjs" | ||
} |
@@ -529,3 +529,3 @@ import { Edge, JimpClass } from "@jimp/types"; | ||
*/ | ||
invert<I_1 extends JimpClass>(image: I_1): I_1; | ||
invert<I extends JimpClass>(image: I): I; | ||
/** | ||
@@ -543,3 +543,3 @@ * Adjusts the brightness of the image | ||
*/ | ||
brightness<I_2 extends JimpClass>(image: I_2, val: number): I_2; | ||
brightness<I extends JimpClass>(image: I, val: number): I; | ||
/** | ||
@@ -557,3 +557,3 @@ * Adjusts the contrast of the image | ||
*/ | ||
contrast<I_3 extends JimpClass>(image: I_3, val: number): I_3; | ||
contrast<I extends JimpClass>(image: I, val: number): I; | ||
/** | ||
@@ -571,3 +571,3 @@ * Apply a posterize effect | ||
*/ | ||
posterize<I_4 extends JimpClass>(image: I_4, n: number): I_4; | ||
posterize<I extends JimpClass>(image: I, n: number): I; | ||
/** | ||
@@ -584,3 +584,3 @@ * Removes colour from the image using ITU Rec 709 luminance values | ||
*/ | ||
greyscale<I_5 extends JimpClass>(image: I_5): I_5; | ||
greyscale<I extends JimpClass>(image: I): I; | ||
/** | ||
@@ -598,3 +598,3 @@ * Multiplies the opacity of each pixel by a factor between 0 and 1 | ||
*/ | ||
opacity<I_6 extends JimpClass>(image: I_6, f: number): I_6; | ||
opacity<I extends JimpClass>(image: I, f: number): I; | ||
/** | ||
@@ -611,3 +611,3 @@ * Applies a sepia tone to the image. | ||
*/ | ||
sepia<I_7 extends JimpClass>(image: I_7): I_7; | ||
sepia<I extends JimpClass>(image: I): I; | ||
/** | ||
@@ -625,3 +625,3 @@ * Fades each pixel by a factor between 0 and 1 | ||
*/ | ||
fade<I_8 extends JimpClass>(image: I_8, f: number): I_8; | ||
fade<I extends JimpClass>(image: I, f: number): I; | ||
/** | ||
@@ -642,3 +642,3 @@ * Adds each element of the image to its local neighbors, weighted by the kernel | ||
*/ | ||
convolution<I_9 extends JimpClass>(image: I_9, options: ConvolutionOptions): I_9; | ||
convolution<I extends JimpClass>(image: I, options: ConvolutionOptions): I; | ||
/** | ||
@@ -655,3 +655,3 @@ * Set the alpha channel on every pixel to fully opaque. | ||
*/ | ||
opaque<I_10 extends JimpClass>(image: I_10): I_10; | ||
opaque<I extends JimpClass>(image: I): I; | ||
/** | ||
@@ -672,3 +672,3 @@ * Pixelates the image or a region | ||
*/ | ||
pixelate<I_11 extends JimpClass>(image: I_11, options: PixelateOptions): I_11; | ||
pixelate<I extends JimpClass>(image: I, options: PixelateOptions): I; | ||
/** | ||
@@ -697,3 +697,3 @@ * Applies a convolution kernel to the image or a region | ||
*/ | ||
convolute<I_12 extends JimpClass>(image: I_12, options: ConvoluteOptions): I_12; | ||
convolute<I extends JimpClass>(image: I, options: ConvoluteOptions): I; | ||
/** | ||
@@ -715,5 +715,5 @@ * Apply multiple color modification rules | ||
*/ | ||
color<I_13 extends JimpClass>(image: I_13, actions: ColorAction[]): I_13; | ||
color<I extends JimpClass>(image: I, actions: ColorAction[]): I; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -284,4 +284,6 @@ import tinyColor from "tinycolor2"; | ||
image.bitmap.data[idx] += (255 - image.bitmap.data[idx]) * val; | ||
image.bitmap.data[idx + 1] += (255 - image.bitmap.data[idx + 1]) * val; | ||
image.bitmap.data[idx + 2] += (255 - image.bitmap.data[idx + 2]) * val; | ||
image.bitmap.data[idx + 1] += | ||
(255 - image.bitmap.data[idx + 1]) * val; | ||
image.bitmap.data[idx + 2] += | ||
(255 - image.bitmap.data[idx + 2]) * val; | ||
} | ||
@@ -288,0 +290,0 @@ }); |
{ | ||
"type": "module", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"sideEffects": false | ||
} | ||
"type": "module" | ||
} |
{ | ||
"name": "@jimp/plugin-color", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"repository": "jimp-dev/jimp", | ||
@@ -10,3 +10,4 @@ "scripts": { | ||
"build": "tshy", | ||
"dev": "tshy --watch" | ||
"dev": "tshy --watch", | ||
"clean": "rm -rf node_modules .tshy .tshy-build dist .turbo" | ||
}, | ||
@@ -16,8 +17,9 @@ "author": "Andrew Lisowski <lisowski54@gmail.com>", | ||
"devDependencies": { | ||
"@jimp/config-eslint": "1.0.2", | ||
"@jimp/config-typescript": "1.0.2", | ||
"@jimp/config-vitest": "1.0.2", | ||
"@jimp/js-jpeg": "1.0.2", | ||
"@jimp/js-png": "1.0.2", | ||
"@jimp/test-utils": "1.0.2", | ||
"@jimp/config-eslint": "1.0.3", | ||
"@jimp/config-typescript": "1.0.3", | ||
"@jimp/config-vitest": "1.0.3", | ||
"@jimp/js-jpeg": "1.0.3", | ||
"@jimp/js-png": "1.0.3", | ||
"@jimp/test-utils": "1.0.3", | ||
"@types/node": "^20.12.5", | ||
"@types/tinycolor2": "^1.4.6", | ||
@@ -27,3 +29,3 @@ "@vitest/browser": "^1.4.0", | ||
"tshy": "^1.12.0", | ||
"typescript": "^5.4.2", | ||
"typescript": "^5.5.4", | ||
"vite-plugin-node-polyfills": "^0.21.0", | ||
@@ -33,5 +35,5 @@ "vitest": "^1.4.0" | ||
"dependencies": { | ||
"@jimp/core": "1.0.2", | ||
"@jimp/types": "1.0.2", | ||
"@jimp/utils": "1.0.2", | ||
"@jimp/core": "1.0.3", | ||
"@jimp/types": "1.0.3", | ||
"@jimp/utils": "1.0.3", | ||
"tinycolor2": "^1.6.0", | ||
@@ -69,3 +71,3 @@ "zod": "^3.22.4" | ||
"sideEffects": false, | ||
"gitHead": "5e52bfd76c68b45db3a7a2ed8450e47f1fcf8853" | ||
"gitHead": "4b35cc0866903bc9e5d48d31ca34fcbec9ab111f" | ||
} |
@@ -67,3 +67,3 @@ import tinyColor from "tinycolor2"; | ||
) { | ||
const value = [0, 0, 0]; | ||
const value = [0, 0, 0] as [number, number, number]; | ||
const size = (kernel.length - 1) / 2; | ||
@@ -240,5 +240,5 @@ | ||
image.scan((_, __, index) => { | ||
histogram.r[image.bitmap.data[index + 0]!]++; | ||
histogram.g[image.bitmap.data[index + 1]!]++; | ||
histogram.b[image.bitmap.data[index + 2]!]++; | ||
histogram.r[image.bitmap.data[index + 0]!]!++; | ||
histogram.g[image.bitmap.data[index + 1]!]!++; | ||
histogram.b[image.bitmap.data[index + 2]!]!++; | ||
}); | ||
@@ -362,9 +362,11 @@ | ||
if (val < 0.0) { | ||
image.bitmap.data[idx] *= 1 + val; | ||
image.bitmap.data[idx + 1] *= 1 + val; | ||
image.bitmap.data[idx + 2] *= 1 + val; | ||
image.bitmap.data[idx]! *= 1 + val; | ||
image.bitmap.data[idx + 1]! *= 1 + val; | ||
image.bitmap.data[idx + 2]! *= 1 + val; | ||
} else { | ||
image.bitmap.data[idx] += (255 - image.bitmap.data[idx]!) * val; | ||
image.bitmap.data[idx + 1] += (255 - image.bitmap.data[idx + 1]!) * val; | ||
image.bitmap.data[idx + 2] += (255 - image.bitmap.data[idx + 2]!) * val; | ||
image.bitmap.data[idx]! += (255 - image.bitmap.data[idx]!) * val; | ||
image.bitmap.data[idx + 1]! += | ||
(255 - image.bitmap.data[idx + 1]!) * val; | ||
image.bitmap.data[idx + 2]! += | ||
(255 - image.bitmap.data[idx + 2]!) * val; | ||
} | ||
@@ -371,0 +373,0 @@ }); |
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
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
3803
635139
14
35
+ Added@jimp/core@1.0.3(transitive)
+ Added@jimp/file-ops@1.0.3(transitive)
+ Added@jimp/types@1.0.3(transitive)
+ Added@jimp/utils@1.0.3(transitive)
- Removed@jimp/core@1.0.2(transitive)
- Removed@jimp/file-ops@1.0.2(transitive)
- Removed@jimp/types@1.0.2(transitive)
- Removed@jimp/utils@1.0.2(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbuffer@6.0.3(transitive)
Updated@jimp/core@1.0.3
Updated@jimp/types@1.0.3
Updated@jimp/utils@1.0.3