Skip to main content

Convert images to character art with support for multiple character sets and formats

Project description

Characterize

Convert images to character art with support for multiple character sets and formats.

Features

  • Multiple character sets (ASCII, Emoji, Chinese, etc.)
  • Color and black/white modes
  • Multiple output formats (PNG, JPG, TXT)
  • Batch processing support
  • Automatic character selection based on brightness
  • GUI interface for easy use
  • Command-line interface for automation
  • Image optimization capabilities
  • Large image subdivision support

Installation

pip install characterize

Quick Start

Command Line

Convert a single image:

characterize -i image.jpg -s ascii

Convert multiple images:

characterize -i image1.jpg image2.png -s emoji --color

Convert all images in a directory:

characterize -i ./images/ -s chinese --color --optimize

Python API

from characterize import convert_image

# Simple conversion
output_path = convert_image(
    "input.jpg",
    "output",
    character_set="ascii"
)

# Advanced options
output_path = convert_image(
    "input.jpg",
    "output",
    character_set="emoji",
    detail_level=15,
    complexity=20,
    color_mode=True,
    subdivide=True,
    optimize=True,
    empty_char=True,
    output_formats=["png", "txt"]
)

Command Line Options

  • -i, --input: Input image files or directories
  • -s, --character-set: Character set to use (default: ascii)
    • Available sets: ascii, arabic, braille, chinese, cyrillic, emoji, hangul, hiragana, katakana, kanji, latin, numbers, numbers+, roman, simple
  • -d, --detail-level: Detail level (character size in pixels, default: 12)
  • -c, --complexity: Number of different characters to use (default: 12)
  • --color: Enable color output
  • --subdivide: Subdivide large images
  • --optimize: Optimize output files
  • --empty-char: Include empty character for darker areas
  • -f, --formats: Output formats (png, jpg, txt)

Character Sets

Each character set has different characteristics suitable for different types of images:

  • ascii: Good for general use, wide brightness range (2-81)
  • emoji: Best for color images, largest brightness range (31-173)
  • chinese: Excellent detail, wide range (0-107)
  • braille: Compact representation, small range (3-18)
  • numbers: Clean look, moderate range (21-43)
  • roman: Serif style, good contrast (27-81)

Development

Setup Development Environment

  1. Clone the repository:
git clone https://github.com/kodu-ai/characterize.git
cd characterize
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows
  1. Install development dependencies:
pip install -e ".[dev]"

Running Tests

pytest tests/

Building Documentation

cd docs
make html

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Acknowledgments

  • PIL/Pillow for image processing
  • NumPy for numerical operations
  • The open-source community for font resources

Troubleshooting

Common Issues

  1. Font Not Found

    • Ensure required system fonts are installed
    • Use custom fonts by specifying font_path
  2. Memory Issues

    • Use --subdivide for large images
    • Reduce detail_level for faster processing
  3. Quality Issues

    • Adjust complexity for more/fewer characters
    • Try different character sets
    • Enable color mode for color-rich images

Error Messages

  • "Font not found": Install required system fonts
  • "Image too large": Use --subdivide option
  • "Invalid character set": Check available sets

Support

  • GitHub Issues: Bug reports and feature requests
  • Documentation: Full API reference and examples
  • Email: support@kodu.ai

Roadmap

  • Additional character sets
  • Custom character set support
  • Animation support
  • Web interface
  • Cloud processing support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

img_characterize-0.3.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

img_characterize-0.3-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file img_characterize-0.3.tar.gz.

File metadata

  • Download URL: img_characterize-0.3.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for img_characterize-0.3.tar.gz
Algorithm Hash digest
SHA256 94ac1299f4e807b603f80df41b3e67c234ca3766da276ccda2a27f5ec2dbadc9
MD5 1e1c318b1a90fadea88e9627b7b79610
BLAKE2b-256 53ccd2a7e35d68820b5617c01951ea89ea0d235b09bd117e0d8718032b59cef6

See more details on using hashes here.

File details

Details for the file img_characterize-0.3-py3-none-any.whl.

File metadata

  • Download URL: img_characterize-0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for img_characterize-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 95a45060bc044f4616d9087f7c34e6a4196fb7be70aefd3eaeb8f6c4aed2b6bb
MD5 f4b28073fa5f394885bd92909add340d
BLAKE2b-256 44a8b25775deb576485c7c1ba94a5b965bd9ba3e3cc6c0a76f604fc10e724cf3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page