PaintByChar

PaintByChar logo

License: MIT Python 3.12 PyPI version Docs Tests

A tiny Python library for turning ASCII grids into colorful images. It is designed for quick visualizations of mazes, maps, game boards, and Advent of Code-style 2D text puzzles.

Why PaintByChar?

Features

Install

pip install paintbychar

Quick example

import paintbychar as pbc

grid = """0123
4567
89AB
"""

img = pbc.string_to_image(
    grid,
    preset="viridis",
    cell_size=24,
    render_style=pbc.RenderStyle.COLORED_CELLS,
)

pbc.save_image(img, "output_basic.png")

Example output

Basic example output

More example images

Styled text output Preset output

More examples

The repository includes several runnable examples in the examples/ folder, including:

API reference

See the documentation for a quick overview of the public functions and options, or browse the live docs site.

There is also documentation on Read the Docs with installation instructions, usage examples, and API reference. Read the Docs

Contributing

Contributions are welcome. See CONTRIBUTING.md for setup instructions, testing guidance, and the pull request process.

Code of conduct

This project follows the Contributor Covenant Code of Conduct.

License

This project is licensed under the MIT License.

The bundled Roboto Mono font is separately licensed under the SIL Open Font License (OFL). See src/fonts/OFL.txt for its license terms.

Project status

PaintByChar is currently a small, focused library aimed at grid-based text rendering and visualization. It is suitable for personal, educational, and open-source use, and is prepared for broader community contributions as it matures.

Social preview

A repository preview image is included in assets/social-preview.png and can be used as a GitHub social preview or banner asset.