Skip to main content

Convert images and video to ASCII art

Project description

asciiify

Python library and CLI for converting images to ASCII art. Powered by Rust via PyO3.

Part of the asciiify project.

Install

pip install asciiify

CLI

Installing the package also provides the asciiify command:

# Convert an image
asciiify image.png

# Braille mode, custom width
asciiify photo.jpg -m braille -w 100

# Output to file
asciiify image.png -o output.txt

# All options
asciiify --help

Or via python -m:

python -m asciiify image.png -m half-block -w 80

Library Usage

import asciiify

# Convert image file
print(asciiify.convert("image.png"))

# With options
art = asciiify.convert("photo.jpg", mode="braille", width=100, height=50)

# Convert from bytes
with open("image.png", "rb") as f:
    art = asciiify.convert_bytes(f.read(), mode="half-block", width=80)

# Reusable converter with preset options
converter = asciiify.Converter(mode="ascii", width=120, invert=True)
art = converter.convert("image.png")
art = converter.convert_bytes(data)

Output Modes

Mode Description
"ascii" Classic character ramp (default)
"half-block" Unicode blocks, 2x vertical resolution
"braille" Unicode braille, 4x vertical resolution

API

convert(path, *, mode="ascii", width=None, height=None, invert=False, charset=None) -> str

Convert an image file to ASCII art.

convert_bytes(data, *, mode="ascii", width=None, height=None, invert=False, charset=None) -> str

Convert in-memory image bytes to ASCII art.

Converter(*, mode="ascii", width=None, height=None, invert=False, charset=None)

Reusable converter with preset options. Has .convert(path) and .convert_bytes(data) methods.

License

MIT

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

asciiify-0.2.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distributions

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

asciiify-0.2.0-cp39-abi3-win_amd64.whl (807.1 kB view details)

Uploaded CPython 3.9+Windows x86-64

asciiify-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

asciiify-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (989.4 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

asciiify-0.2.0-cp39-abi3-macosx_11_0_arm64.whl (912.1 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

asciiify-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl (974.5 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file asciiify-0.2.0.tar.gz.

File metadata

  • Download URL: asciiify-0.2.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for asciiify-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3c185f179de0e69707de14835f1960e5e1f28cc2f7076698cda4559f52604daa
MD5 ccd6c6c9149bb1b2826de279ab80b8de
BLAKE2b-256 44410945217bc71ba22ccfd8cf721fa1db5aab048c8daa25e43043653b7b3a55

See more details on using hashes here.

Provenance

The following attestation bundles were made for asciiify-0.2.0.tar.gz:

Publisher: release.yml on tomerramk/asciiify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file asciiify-0.2.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: asciiify-0.2.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 807.1 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for asciiify-0.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 07b313f925e86023971daf9feed7c95d7373d9a491cf75a57098145550785336
MD5 b28169bda253a21cd6de5217824f1969
BLAKE2b-256 f8a03b6230136324f40a71e1227ae12764b05f08d6b47b86d8c88ab93aff2161

See more details on using hashes here.

Provenance

The following attestation bundles were made for asciiify-0.2.0-cp39-abi3-win_amd64.whl:

Publisher: release.yml on tomerramk/asciiify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file asciiify-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for asciiify-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1e7ad77e2b6cab783fe35588cde49e49a6afbcf207a63d088e91543d75c8a967
MD5 0f37d66ecc64717e54d45c234bdf7f04
BLAKE2b-256 b16fb15eb489909c99c9af355b8abb57a9058b643316b4e11620812ebf3d6fe2

See more details on using hashes here.

Provenance

The following attestation bundles were made for asciiify-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on tomerramk/asciiify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file asciiify-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for asciiify-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 26b18af4e41081ccec5cee954ffb8a7161885bd2d9579452f46fad3fda6f1a74
MD5 46a949061ca499200c924d4be96cfc3e
BLAKE2b-256 ec90f34a3910537ed2572409d1f50819b5687c16554eba3daac0bab1c961cd0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for asciiify-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on tomerramk/asciiify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file asciiify-0.2.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for asciiify-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 06a1102cc93dfbffbad432690bfabdde3d4fd25a8b50a799ef59d2d0685914e2
MD5 3d679757fa5df4abc454c4d47b7810ce
BLAKE2b-256 c230db6e996a6263443f8dd93ea303832ff0b86f7753e3eb46be77e8b95d4066

See more details on using hashes here.

Provenance

The following attestation bundles were made for asciiify-0.2.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on tomerramk/asciiify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file asciiify-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for asciiify-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a4a48568e1c1540d11f25e095f5d7ecee4b104e9a80a73dfae54257aedc4a8fd
MD5 e393b430da4b99f9da18f3e81abc94fe
BLAKE2b-256 1f3088463bfd276e15c338fd5bcba59a84c343b18a2d4efb11f0fd740244ef00

See more details on using hashes here.

Provenance

The following attestation bundles were made for asciiify-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on tomerramk/asciiify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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