A Python package for generating various visual representations of text in SVG format.
-
Install Ghostscript (required for barcode generation):
- Windows: Download and install from Ghostscript website
- Linux:
sudo apt-get install ghostscript
- macOS:
brew install ghostscript
-
Install the package:
pip install -e .
Generates SVG visualizations of text using 10 distinct encoding methods:
- Binary Stripe: Binary bar code representation
- Morse Code Band: Dots and dashes visualization
- Circuit Trace Silhouette: Circuit board-like pattern (5x7 grid per character)
- Dot Grid Steganography: Grid with highlighted letters
- Semaphore Flags: Flag position visualization
- A1Z26 Numeric Stripe: Numeric representation of letters (A=1, Z=26)
- Code128 Barcode: Standard Code128 barcode format
- Waveform Stripe: Waveform visualization based on character ASCII values
- Chevron Stripe: Chevron pattern based on binary representation
- Braille Stripe: Visual representation of Braille characters
encoderize --text "HELLO" --output-dir output
Options:
--text
,-t
: Text to visualize (required)--output-dir
,-o
: Output directory (default: 'output')--dark
: Generate dark mode versions (white on black)--light
: Generate light mode versions (black on white)
If neither --dark
nor --light
is specified, both versions will be generated.
WIP
For input text like "HELLO"
, the output structure will be:
output/
└── HELLO/
├── light/
│ ├── binary_stripe_HELLO.svg
│ ├── morse_code_band_HELLO.svg
│ ├── circuit_trace_silhouette_HELLO.svg
│ ├── dot_grid_steganography_HELLO.svg
│ ├── semaphore_flags_HELLO.svg
│ ├── a1z26_stripe_HELLO.svg
│ ├── code128_barcode_HELLO.svg
│ ├── waveform_stripe_HELLO.svg
│ ├── chevron_stripe_HELLO.svg
│ └── braille_stripe_HELLO.svg
└── dark/
├── binary_stripe_HELLO.svg
├── morse_code_band_HELLO.svg
└── ... (and so on for all 10 types)
Each visualization function in encoderize/visualizers.py
accepts optional parameters to customize the appearance (e.g., colors, sizes, spacing, dimensions).
See the function docstrings within encoderize/visualizers.py
for detailed parameter information.
Install development dependencies:
pip install -e ".[dev]"
Run tests:
pytest
Run linters (e.g., flake8, black):
# Example using flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Example using black
black . --check
- Python 3.8 or higher
svgwrite
treepoem
(and its dependency Ghostscript for barcode generation)
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please see the CONTRIBUTING.md file for details on how to report bugs, suggest features, and submit pull requests.
For questions or feedback, please contact Hayden MacIntyre at [email protected].
Made with contrib.rocks.