Skip to content

Latest commit

Β 

History

History
96 lines (62 loc) Β· 1.65 KB

File metadata and controls

96 lines (62 loc) Β· 1.65 KB

🎨 simple-image2ascii - Convert Images & Videos to ASCII Art

Python NumPy OpenCV License

simple-image2ascii is a Python library that transforms images and videos into ASCII art using NumPy and OpenCV.


πŸš€ Installation

Install the library using pip:

pip install simple-image2ascii

πŸ”§ Usage

πŸ“· Convert Image to ASCII

import 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)

πŸŽ₯ Convert Video to ASCII (Using OpenCV)

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()

πŸ›  Features

βœ… Grayscale conversion βœ… Adaptive ASCII mapping βœ… 8Γ—8 pixel block processing βœ… Supports image resizing βœ… Works with both images and videos


πŸ“¦ Dependencies

  • numpy
  • opencv-python

To install dependencies manually:

pip install numpy opencv-python

πŸ“œ License

This project is licensed under the MIT License.


βœ‰ Contact

πŸ™ GitHub: AlekseyScorpi