image-forge
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "image-forge", | ||
"version": "1.1.1", | ||
"description": "A powerful tool for creating custom images from templates, automating the graphic design process", | ||
"main": "index.js", | ||
"version": "1.1.2", | ||
"description": "A powerful tool for creating custom images from templates", | ||
"main": "./src/index.js", | ||
"type": "module", | ||
@@ -29,6 +29,4 @@ "files": [ | ||
"lint-staged": { | ||
"*.{js,json}": [ | ||
"npm run format", | ||
"npm run lint" | ||
] | ||
"*.{js,json}": "npm run format", | ||
"*.js": "npm run lint" | ||
}, | ||
@@ -42,2 +40,12 @@ "config": { | ||
"license": "MIT", | ||
"homepage": "https://github.com/HarukaYamamoto0/image-forge", | ||
"bugs": { | ||
"url": "https://github.com/HarukaYamamoto0/image-forge/issues", | ||
"email": "harukayamamotodev@gmail.com" | ||
}, | ||
"funding": "https://www.buymeacoffee.com/harukayamamoto", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/HarukaYamamoto0/image-forge.git" | ||
}, | ||
"keywords": [ | ||
@@ -44,0 +52,0 @@ "image", |
@@ -0,10 +1,11 @@ | ||
import BaseGenerator from "../../structures/BaseGenerator.js"; | ||
import { createCanvas, loadImage } from "@napi-rs/canvas"; | ||
class GrayFilter { | ||
constructor(imagePath) { | ||
this.imagePath = imagePath; | ||
class GrayFilter extends BaseGenerator { | ||
constructor() { | ||
super(); | ||
} | ||
async apply() { | ||
const image = await loadImage(this.imagePath); | ||
const image = await loadImage(this.source); | ||
const canvas = createCanvas(image.width, image.height); | ||
@@ -27,3 +28,3 @@ const ctx = canvas.getContext("2d"); | ||
return canvas.encode("jpeg"); | ||
return this.encode(canvas, image); | ||
} | ||
@@ -30,0 +31,0 @@ } |
import GrayFilter from "./generators/filters/gray.filter.js"; | ||
import InfraredFilter from "./generators/filters/infrared.filter.js"; | ||
import PixelateFilter from "./generators/filters/pixelate.filter.js"; | ||
export { GrayFilter }; | ||
export { GrayFilter, InfraredFilter, PixelateFilter }; |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
11147
8
126
0
0
0