mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-17 19:19:47 +00:00
Compile JXL encoder
This commit is contained in:
12
codecs/jxl_enc/example.js
Normal file
12
codecs/jxl_enc/example.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const fs = require("fs");
|
||||
const avifEnc = require("./jxl_enc.js")(fs.readFileSync("./jxl_enc.wasm"));
|
||||
|
||||
avifEnc.onRuntimeInitialized = () => {
|
||||
const jxl = avifEnc.encode(
|
||||
new Uint8Array([255, 0, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255]),
|
||||
3,
|
||||
1
|
||||
);
|
||||
console.log(jxl)
|
||||
fs.writeFileSync("lol.jxl", jxl);
|
||||
};
|
||||
Reference in New Issue
Block a user