Skip to main content

A library to convert images to ASCII art using different methods

Project description

pyasciilib

https://github.com/Slinky802/pyasciilib

pyasciilib is a Python library for converting images into ASCII art, using various methods and supporting several languages. It offers customization options, such as output size, ASCII characters used, and output format (text or list of lists).

Contents


Installation

To install the library, use pip :

pip install pyasciilib

Use

Basic example of converting an image to ASCII:

import pyasciilib

# Converts an image to ASCII with default parameters
ascii_art = pyasciilib.image_to_ascii(
    path_to_image=path/to/image.jpg,
    returned=text
    size=(0, 0), #Default value, (0, 0)->same as original image
    chars=["@", "#", "%", "*", "+", "=", "-", ":", "."] # Default characters from more to less dense
)

print(ascii_art)

Features

Output Size: Defines the dimensions (width, height) of the output ASCII image.

ASCII characters: Modifies the list of ASCII characters used, from more to less dense, to obtain the desired output.

Return Method: Choice between “list” (list of lists) or “text” (printable text) for output format.

Supported languages:

  • en : English

  • fr : French

  • es : Spanish

  • de : German

  • it: Italian

  • pt: Portuguese

  • ru: Russian

  • zh: Chinese

  • ja: Japanese

  • ko: Korean

  • ar : Arabic

Use pyasciilib.ascii_help(language) to display instructions according to the selected language.


License

This project is licensed under the MIT license - see the LICENSE file for details.


Contribute

We welcome contributions to improve and expand the pyasciilib library! Whether you want to add a feature, fix a bug, or enhance the documentation, follow these steps to contribute:

Steps to Contribute

  1. Fork the Repository: Create a copy of the project on your GitHub account using the "Fork" button.

  2. Clone the Project: Clone your fork locally to work on the code.

    git clone https://github.com/Slinky802/pyasciilib
    cd pyasciilib
    
  3. Create a New Branch: Before making changes, create a new branch for your work.

    git checkout -b my_new_feature
    
  4. Make Your Changes: Add your modifications or new features.

  5. Submit a Pull Request (PR): Once your changes are ready, push them to your fork, then submit a PR to the master branch of this repository.

  • Describe your changes and their purpose.
  • Mention any related issues you've resolved.
  • Request a code review.

Code Review Policy

To maintain the project's stability and security, we have implemented a branch protection policy:

  • Any changes to the main branch must go through a Pull Request.
  • Each PR requires a review and may need approval before merging.
  • Only administrators and trusted contributors can merge approved PRs.

Contact

Created by Alexandre Poggioli (Slinky802) - alexandrepoggioli09@gmail.com

More information on https://slinky-presentation.netlify.app

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

pyasciilib-1.0.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

pyasciilib-1.0.2-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file pyasciilib-1.0.2.tar.gz.

File metadata

  • Download URL: pyasciilib-1.0.2.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for pyasciilib-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c01fad44a965d9aa22ddba99ec4df97e6d2c0948452554cf1fe6f206df0ea243
MD5 2515e8d1e334c75962e8a8cca0cdcd22
BLAKE2b-256 ba2855e06255d5b3299ff8c3669636091e9c0264b2a2c9ea77f6d54a24e1e5ed

See more details on using hashes here.

File details

Details for the file pyasciilib-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyasciilib-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for pyasciilib-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d429acf7af5c1249a890b4b5e6413e325547912ecbca7bb2bb93cadc6575b62f
MD5 1b76aed31496ed6dac25be90f107533b
BLAKE2b-256 757a1255d33bf61f20767fa95529a000df03fe7a79642250498a052b897b2fa9

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