Skip to content

CLI Usage

@pixzle/cli provides image fragmentation and restoration commands using @pixzle/node.

Installation

bash
npm install -g @pixzle/cli

Shuffle

Fragments images into blocks and shuffles them.

bash
pixzle shuffle <images...> -o <output_directory> [options]
OptionDescriptionRequiredDefault
-o, --output <dir>Output directoryYes-
-b, --block-size <number>Pixel block size-8
-p, --prefix <prefix>Prefix for fragment files-img
-s, --seed <seed>Random seed-Auto-generated 12-character ID
--preserve-namePreserve original file names-false
--cross-image-shuffleShuffle blocks across all images-false
--thumbnailGenerate thumbnails for original images-false
--thumbnail-size <px>Maximum thumbnail width and height-100
bash
pixzle shuffle input.png -o ./output

Generate thumbnails in ./output/thumbnails:

bash
pixzle shuffle input.png -o ./output --thumbnail --thumbnail-size 100

Multiple Images

With --cross-image-shuffle, blocks are mixed across all input images instead of being shuffled independently within each image.

input 1input 2input 3
output 1output 2output 3

WARNING

Restoration with --cross-image-shuffle is currently only supported in Node.js and CLI environments.

Restore With Manifest

bash
pixzle restore <fragments...> -m <manifest_path> -o <output_directory>
OptionDescriptionRequired
-m, --manifest <path>Path to manifest.jsonYes
-o, --output <dir>Output directoryYes
bash
pixzle restore ./output/*.png -m ./output/manifest.json -o ./restored

Restore With Manual Configuration

Restore a single image without a manifest file.

bash
pixzle restore <fragment> -o <output_directory> -b <size> -s <seed> -w <width> -h <height>
OptionDescriptionRequired
-o, --output <dir>Output directoryYes
-b, --block-size <number>Pixel block sizeYes
-s, --seed <seed>Random seedYes
-w, --width <number>Image widthYes
-h, --height <number>Image heightYes
bash
pixzle restore ./fragmented.png -o ./restored -b 10 -s custom-seed -w 500 -h 500

Manifest

json
{
  "id": "631631d5-bcaa-40ac-9c1e-efd6e89e4600",
  "version": "0.0.0",
  "timestamp": "2025-12-04T16:08:41.924Z",
  "config": {
    "blockSize": 8,
    "prefix": "img",
    "seed": "4f90d13aBc42",
    "preserveName": false,
    "crossImageShuffle": false
  },
  "images": [
    {
      "w": 500,
      "h": 500
    }
  ]
}

Released under the MIT License.