Skip to main content

Convert image to ascii art

Project description

asciiart

Convert image to ascii art

Dependency

pip install opencv-python
pip install numpy

Usage

pip install img2ascii
import img2ascii as i2a

import numpy as np
import cv2

img2ascii.py

def img2ascii(filename, color_mode=True, fontsize=5):
return img,newimg # img : original image, newimg : ascii art image

Example 1

filename = 'test.jfif'
origin, newimg = i2a.img2ascii(filename)
if type(newimg) == type(None):
    exit()
cv2.imshow("origin", origin)
cv2.imshow("res", newimg)
cv2.waitKey()
cv2.destroyAllWindows()

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

makeasciiart-0.1-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

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