Simple ASCII Art Generator (Using Patch Averaging)
This 10 and 70 levels of ASCII art are created only using cv.resize
function.
First, we convert the image into grayscale, then we resize it (for instance, the column size is 80).
After that, we take pixel color values and map them to a character based on intensity (0-255).


These 10 and 70 levels of ASCII art are created using cv.resize
function and a patch extraction method.
First, we convert the image into grayscale, resize it to a patch-extractable size (so we can get 80 columns without
zero-dimension patches), and keep the aspect ratio as close as possible. Then we take each patch, calculate its
average color value, and assign an ASCII character accordingly (for both 10 and 70 levels).
Data Science-based ASCII Art Generator




This code and outputs are created for the Calibri font, for PCA values 3, 5, and 7.
The text files are also saved in the ds
folder. The output is not very clear visually.



These ASCII art outputs are created for Times New Roman font, with PCA values 3, 5, and 7.
The text files are also saved in the ds
folder. The result is somewhat better
than Calibri but still less clear compared to the simpler 10-level or 70-level ASCII methods.
Movie ASCII Art Generator
Experience the transformation of video frames into ASCII art in real-time, complete with embedded audio.
This code and output demonstrate the 10-level grayscale ASCII art video.
The ASCII columns here are 160 (2 × 80), and the number of rows is adjusted
according to the aspect ratio. The intermediate raw frames (in .npy
format)
are quite large (~8 GB), so only the final ASCII frames and video are included.
This is the 70-level grayscale ASCII art video, with columns set to 160 (2 × 80). The aspect ratio is maintained by adjusting the number of rows. The 80-column version looked very basic, so it's omitted here.
This is the PCA-based version of the ASCII art movie (Roman font, PCA=5, 80 columns). The code took ~10 hours to run (even the ChatGPT-optimized version). Managing the thousands of frames (~10k files) and associated size was quite challenging.
This is another high-quality ASCII video output, using 240 columns (3 × 80),
maintaining aspect ratio by adjusting rows. The extracted frames in .npy
format total ~8 GB, so only the ASCII frames and the final video are included here.
This is the best output so far, with 320 columns in color.
The extracted color frames total ~22 GB in .npy
format,
so again, only the final ASCII frames and video are provided.
Challenges Faced
The development of ASCII art required overcoming multiple challenges:
- Image Preprocessing: Ensuring that resizing does not distort the aspect ratio significantly.
- Character Mapping: Finding the best character set to represent different intensity levels.
- Computational Complexity: Handling large image and video files efficiently.
- Storage: Managing the large dataset of frames and intermediate outputs.