Sundry
Offline-first desktop toolbox for everyday tasks: images, vectorization,
converters, text and files. Written in Rust.
Status: early development. The core library (crates/core) and the
command-line frontend (crates/cli) exist; the desktop shell (crates/app, Slint) is in progress. Tools so far: data size converter, image resize, image format conversion and corner rounding (batch, before/after preview, ZIP/7z export).
Build
cargo test --workspace
Desktop app
cargo run -p sundry-app
Requires Rust 1.92 or newer.
CLI
sundry list [-c CATEGORY] [QUERY]
sundry info <tool>
sundry <tool> [-i FILE | -t TEXT]... [-p NAME=VALUE]... [-o PATH]
Resize all photos to 1920x1080 (padded) into a folder:
cargo run -p sundry-cli -- image.resize -i a.jpg -i b.png -p width=1920 -p height=1080 -o out/
Convert images to WebP:
cargo run -p sundry-cli -- image.convert -i a.png -i b.jpg -p format=webp -o out/
Compress by quality (percent), or down to a share of the original size (JPEG, WebP and AVIF; PNG is only optimised without loss):
cargo run -p sundry-cli -- image.compress -i a.jpg -p quality=70 -o out/
cargo run -p sundry-cli -- image.compress -i a.png -p mode=size -p size_percent=30 -p format=jpeg -o out/
Round corners (radius 20 %; 100 % makes a circle from a square picture):
cargo run -p sundry-cli -- image.round_corners -i a.jpg -p unit=percent -p radius_percent=20 -o out/
Crop to a 16:9 frame (centered), or cut a rectangle (x, y, width, height in pixels):
cargo run -p sundry-cli -- image.crop -i a.jpg -p ratio=16:9 -o out/
cargo run -p sundry-cli -- image.crop -i a.jpg -p mode=box -p x=100 -p y=50 -p width=800 -p height=600 -o out/
Rotate by 90 degrees clockwise, or by any angle (-p angle=custom -p degrees=15):
cargo run -p sundry-cli -- image.rotate -i a.jpg -p angle=90 -o out/
Mirror left-right (vertical flips top-bottom):
cargo run -p sundry-cli -- image.flip -i a.jpg -p direction=horizontal -o out/
Example (data size converter):
cargo run -p sundry-cli -- convert.data -p value=15 -p from=kB -p to=Mbit
License
PolyForm Noncommercial 1.0.0.
This software is based in part on the work of the Independent JPEG Group (through the jpeg-encoder crate).
评论