@pixzle/node
v0.1.7
Published
Node.js implementation of image fragmentation and restoration
Maintainers
Readme
@pixzle/node
Node.js implementation of image fragmentation and restoration.
Installation
npm i @pixzle/nodeUsage
import pixzle from "@pixzle/node";Shuffle
await pixzle.shuffle({
// config: { /** FragmentationConfig */ },
images: [
"./input_1.png",
"./input_2.png",
"./input_3.png",
],
outputDir: "./output/fragmented",
});output
└── fragmented
├── img_1_fragmented.png
├── img_2_fragmented.png
├── img_3_fragmented.png
└── manifest.json| input 1 | input 2 | input 3 |
|:-------:|:---------------:|:---------------:|
|
|
|
|
| 500 x 500px (109KB) | 400 x 600px (4KB) | 600 x 400px (3KB) |
| output 1 | output 2 | output 3 |
|:-------:|:---------------:|:---------------:|
|
|
|
|
| 504 x 504px (159KB) | 496 x 488px (39KB) | 496 x 488px (35KB) |
Restore
await pixzle.restore({
manifest: "./output/fragmented/manifest.json",
images: [
"./output/fragmented/img_1_fragmented.png",
"./output/fragmented/img_2_fragmented.png",
"./output/fragmented/img_3_fragmented.png",
],
outputDir: "./output/restored",
});output
└── restored
├── img_1.png
├── img_2.png
└── img_3.png| input 1 | input 2 | input 3 |
|:-------:|:---------------:|:---------------:|
|
|
|
|
| 504 x 504px (159KB) | 496 x 488px (39KB) | 496 x 488px (35KB) |
| output 1 | output 2 | output 3 |
|:-------:|:---------------:|:---------------:|
|
|
|
|
| 500 x 500px (116KB) | 400 x 600px (2KB) | 600 x 400px (2KB) |
