#image #converter #front-end #image-cli #cli #extension #output-image

bin+lib stew

Stew is a set of image transformation tools. It allows images to be transformed using individual executables and allows pipes to be used to combine multiple tools.

2 unstable releases

0.2.0 Feb 27, 2019
0.1.0 Feb 6, 2019

#14 in #output-image

21 downloads per month

MIT license

99KB
2K SLoC

Stew

Stew is a set of image transformation tools, adapted from sic. Sic specifically has a single executable whereas Stew has a separate executable for each image operation. This allows the tools in the Stew toolset to be piped to each other and interchangeably with other cli applications (assuming the output of such tool is supported as input format by Stew).


crates.io: Stew

Install

With cargo install: cargo install --force stew

Pre build binary: see releases

From the source of this repo:

  • Setup rust and cargo with (for example) rustup
    Rust version >= 1.31 with 'Rust edition 2018' is required.
  • Clone this repo: git clone https://github.com/foresterre/stew.git
  • Switch to this repo: cd stew
  • Build a release: cargo build --release

Usage

These example usages assume the input image is botanical.jpg and the output image is out.png.

crop -i botanical.jpg -o out.png 10 10 210 210
cat botanical.jpg | crop 10 20 180 210 | blur 15 |  fliph -o target/out.png
cat resources/botanical.jpg | ./target/debug/blur 80 |  ./target/debug/brighten -o target/out.png -70

Note: when stdout is used for the image output, extensions can't be used to determine the image output format. All Stew tools default to BMP as output format, but you can specify a different option using the --output-format (shorthand -f) cli option, as demonstrated below:

cat resources/botanical.jpg | ./target/debug/unsharpen -f png 40 10 > target/out.png

Show usage of individual tools by running them with the help flag: <tool> --help, for example huerotate --help.

Available tools:

  • blur [u32]
  • brighten [i32]
  • contrast [f32]
  • convert
  • crop [u32] [u32] [u32] [u32]
  • filter3x3 [f32] [f32] [f32] [f32] [f32] [f32] [f32] [f32] [f32]
  • fliph
  • flipv
  • grayscale
  • huerotate [i32]
  • invert
  • resize [u32] [u32]
  • rotate90
  • rotate180
  • rotate270
  • unsharpen [f32] [i32]

Suggestions, Questions, Bugs

Feel free to open an issue 📬 if you have a suggestion, a question or found a bug =).

🎸 🎺 🎻 🎷

Dependencies

~13MB
~86K SLoC