A Rust-based command-line tool to convert image files into CSV format and vice versa.
This CLI tool converts images into a CSV format where each line represents a pixel with its coordinates and RGB values.
It can also take a CSV file in this format as input and generate an image.
Each line in the CSV file represents a pixel's coordinates (X and Y) and its RGB values:
X:Y R G B
X:Y
- The pixel's coordinates.R G B
- The pixel's RGB color values.
- Input: An image file (e.g., PNG, JPEG).
- Output: CSV format printed to STDOUT.
pixels to-csv <img_file.jpg>
- Input: CSV format from STDIN.
- Output: An image file.
pixels to-image -o OUTPUT_IMAGE.png < CSV_FILE.csv
# or
cat CSV_FILE.csv | pixels to-image -o OUTPUT_IMAGE.png
git clone https://github.com/talis-fb/img-to-csv.git
cd img-to-csv
cargo build --release
sudo mv target/release/pixels /usr/local/bin/
The final binary is called pixels
.
- Clone the repository:
git clone https://github.com/talis-fb/img-to-csv.git
- Navigate to the project directory:
cd img-to-csv
- Build the project:
cargo build --release
- Move the binary to a directory in your PATH, for example:
sudo mv target/release/pixels /usr/local/bin/
- The final binary is called
pixels
.
pixels to-csv <...>
pixels to-image <...>