Tool for images coding and chipering
!!!Warning!!!
during encoding input image is rewritten with a new pallete of a specified size (256 colors max)
Tool features:
- Encoding as palette-based image with the Floyd-Steinberg dithering. Palette is generated with median-cut algorithm
- AES128 encryption-decryption (length-preserving) for pixels data available (header data stays unchanged)
- Zstandard compression for pixels data available
- Multi-threaded processing
Build:
cargo build --release
Usage:
exe [options] [input_file_path] [output_file_path] [palette_size(2..256 inclusively)] [base64url_key]
options:
- i - info mode: input - existing [input_file_path], output - stderr
- e - encode mode: input - existing [input_file_path], [palette_size], output - saved [output_file_path] or stderr
- d - decode mode: input - existing [input_file_path], [palette_size], output - saved [output_file_path] or stderr
- c - encryption-decryption flag
- z - compression-decompression flag: requires additional [base64url_key] arg at last position
- g - 16bytes base64url stdout key gen
Examples:
-
./target/release/rust_image-codec ecz image.png encoded.bin 256 dozR7XYsRBdDmHhHtRmCJg: *saved ./encoded.bin file
-
./target/release/rust_image-codec dcz encoded.bin decoded.png dozR7XYsRBdDmHhHtRmCJg: *saved ./decoded.png image
Encoded header format (before compression):
- first three bytes - image dimensions (both are 1-based)
- fourth byte - palette size (1-based)
- next 3 * {palette_size} bytes - rgb8 colors
- rest of bytes - pixels data as byte-sized palette indices
Some details:
- max image dimensions are 4096x4096

