Skip to content

A tool to convert easily images to CSV format and vice versa

Notifications You must be signed in to change notification settings

talis-fb/img-to-csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image to CSV / Pixels

A Rust-based command-line tool to convert image files into CSV format and vice versa.

Overview

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.

How It Works

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.

Image -> CSV

  • Input: An image file (e.g., PNG, JPEG).
  • Output: CSV format printed to STDOUT.
pixels to-csv <img_file.jpg>

CSV -> Image

  • 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

How to install

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.

How to Install

  1. Clone the repository:
git clone https://github.com/talis-fb/img-to-csv.git
  1. Navigate to the project directory:
cd img-to-csv
  1. Build the project:
cargo build --release
  1. Move the binary to a directory in your PATH, for example:
sudo mv target/release/pixels /usr/local/bin/
  1. The final binary is called pixels.
pixels to-csv <...>
pixels to-image <...>

About

A tool to convert easily images to CSV format and vice versa

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages