A powerful, TUI-driven command-line tool for seamless conversion between images and their numerical vector representations.
- All-in-One Tool: A single script to handle all conversions and checks.
- Rich TUI: A beautiful and intuitive interface powered by the
richlibrary, featuring styled panels, tables, and progress bars. - Clear Sub-commands: Easy-to-use sub-commands (
convert,check) for clear and separate actions. - Multiple Formats: Supports both plain text (
.txt) and JSON (.json) for vector files. - Dimension Analysis: Automatically calculates and displays possible image dimensions from a vector file.
-
Clone the repository (or download the script):
git clone https://github.com/rkstudio585/pixelvector.git cd pixelvector -
Install the required Python libraries: PixelVector requires
Pillowfor image processing andrichfor the enhanced TUI. You can install them using pip:pip install Pillow rich
The tool is organized into two main sub-commands: convert and check.
This command takes an image file and converts it into a numerical vector.
python img-vec-tool.py convert to-vector <input_image> <output_file> [--format <format>]Example:
python img-vec-tool.py convert to-vector my_image.png vector.txt --format txtThis command reconstructs an image from a vector file. You must provide the correct width and height of the target image.
python img-vec-tool.py convert to-image <input_file> <output_image> <width> <height> [--format <format>]Example:
python img-vec-tool.py convert to-image vector.txt new_image.png 1920 1080This command is used to inspect the dimensions of an image or the size and possible dimensions of a vector file. This is very useful for finding the correct width and height for the to-image command.
python img-vec-tool.py check [--image <path>] [--vector <path>]Examples:
-
Check an image:
python img-vec-tool.py check --image my_image.png
-
Check a vector file:
python img-vec-tool.py check --vector vector.txt
-
Check both at once for a quick comparison:
python img-vec-tool.py check --image my_image.png --vector vector.txt
This project is licensed under the MIT License. See the LICENSE file for details.