greenriver

Crates.iogreenriver
lib.rsgreenriver
version0.1.3
sourcesrc
created_at2023-01-21 06:14:59.3328
updated_at2023-01-28 16:10:38.887422
descriptionA command line tool to work with greenfield images
homepagehttps://github.com/Tomcat-42/greenriver
repositoryhttps://github.com/Tomcat-42/greenriver
max_upload_size
id763988
size44,797
Pablo Alessandro Santos Hugen (Tomcat-42)

documentation

https://docs.rs/greenriver

README

Greenriver

A command line tool to work with greenfield images

GitHub Repo stars

Installation

This command line tool is available on crates.io/crates/greenriver. So, just install it with cargo:

cargo install greenriver

Usage

A command line tool to work with greenfield images

Usage: greenriver <COMMAND>

Commands:
  quantize  Quantizes an image and saves it to a file
  inspect   Inspet an image
  help      Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

quantize

To convert an image on a common file format to greenfield with a quantization level, and saving it to greenfield:

greenriver quantize 5 6 5 Lenna.png Lenna_565.gfd

To convert an image on a common file format to greenfield with a quantization level, and saving it to a common file format (the formats are inferred by file name):

greenriver quantize 5 6 5 Lenna.png Lenna_565.png

lenna Lenna_565

       

convert

To convert between file formats (the formats are inferred by extension, so for greenfield use .gfd):

greenriver convert ./assets/Lenna_565.gfd ./assets/Lenna_565.png

inspect

To get file information about a greenfield image, use the inspect command:

greenriver inspect ./assets/Lenna_565.gfd
┌───────┬─────────────┬────────────┬────────────┬──────────────┬────────────────────────┐
│       │ Magic       │ Width      │ Height     │ Quantization │ Data                   │
├───────┼─────────────┼────────────┼────────────┼──────────────┼────────────────────────┤
│ Value │ b'grnfld42' │ 512        │ 512        │ (5, 6, 5)    │ 512x512 [RGB]          │
├───────┼─────────────┼────────────┼────────────┼──────────────┼────────────────────────┤
│ Size  │ 64 b (8 B)  │ 32 b (4 B) │ 32 b (4 B) │ 9 b (~1 B)   │ 4194304 b (512.00 KiB) │
└───────┴─────────────┴────────────┴────────────┴──────────────┴────────────────────────┘

You can also inspect files in other formats. They will be converted to greenfield (8, 8, 8):

greenriver inspect ./assets/Lenna.png
┌───────┬─────────────┬────────────┬────────────┬──────────────┬────────────────────────┐
│       │ Magic       │ Width      │ Height     │ Quantization │ Data                   │
├───────┼─────────────┼────────────┼────────────┼──────────────┼────────────────────────┤
│ Value │ b'grnfld42' │ 512        │ 512        │ (8, 8, 8)    │ 512x512 [RGB]          │
├───────┼─────────────┼────────────┼────────────┼──────────────┼────────────────────────┤
│ Size  │ 64 b (8 B)  │ 32 b (4 B) │ 32 b (4 B) │ 9 b (~1 B)   │ 6291456 b (768.00 KiB) │
└───────┴─────────────┴────────────┴────────────┴──────────────┴────────────────────────┘
Commit count: 9

cargo fmt