-
-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make brightness function behave like other implementations
- Loading branch information
1 parent
9828a2f
commit bd58915
Showing
5 changed files
with
102 additions
and
16 deletions.
There are no files selected for viewing
Binary file added
BIN
+6.4 KB
...htness-node-test-ts-brightness-3-x-3-box-blur-matrix-using-convolute-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { expect, test, describe } from "vitest"; | ||
import png from "@jimp/js-png"; | ||
import jpeg from "@jimp/js-jpeg"; | ||
import { createJimp } from "@jimp/core"; | ||
import "@jimp/test-utils/image-snapshot"; | ||
|
||
import { methods } from "./index.js"; | ||
|
||
const jimp = createJimp({ formats: [png, jpeg], plugins: [methods] }); | ||
|
||
describe("Brightness", function () { | ||
test("3x3 box blur matrix using convolute", async () => { | ||
const image = await jimp.read(__dirname + "/images/tiles.jpg"); | ||
const output = await image.brightness(2).getBuffer("image/png"); | ||
|
||
expect(output).toMatchImageSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters