simple-image2ascii is a Python library that transforms images and videos into ASCII art using NumPy and OpenCV.
Install the library using pip:
pip install simple-image2asciiimport cv2
import simple_image2ascii
# Load an image
image = cv2.imread("example.jpg")
# Create an ASCIIEngine instance
engine = simple_image2ascii.ASCIIEngine()
# Convert to ASCII
ascii_art = engine.get_ascii(image)
# Print the result
print(ascii_art)import cv2
import simple_image2ascii
cap = cv2.VideoCapture("video.mp4")
engine = simple_image2ascii.ASCIIEngine()
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
ascii_frame = engine.get_ascii(frame)
print(ascii_frame)
cap.release()✅ Grayscale conversion ✅ Adaptive ASCII mapping ✅ 8×8 pixel block processing ✅ Supports image resizing ✅ Works with both images and videos
numpyopencv-python
To install dependencies manually:
pip install numpy opencv-pythonThis project is licensed under the MIT License.
🐙 GitHub: AlekseyScorpi