This repository was copied from this fork, for teaching purposes. The original code is by @ckelyan and is licensed under the MIT license.
This project can be run from the command line with, for example:
python imtascii.py cat.png
This will generate an ASCII version of the template image cat.png
:
Namely:
(225, 224)
@= @#
@@@@= @@@@@
@@@@@@@@-+@@@@@=+@@@@@@@+
+@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@
#@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@
.@@@@@@@@@@@@@@@@@@@@@
:@@@@@@@@@@@@@@@@@@@@@
:@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@=
@@@@@@@@@@@@@@@@*
@@@@@@@@@@@@:
@@@@@@@@@@@@@@@
:@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@=
:@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@:
@@@@@@@@@@@@@@@@@@@@@@*
@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@%@%%@#
@@@@@@@@@@@@@@@@@@@#%@@@@
@@%%%%@%%%%%@%%@%%%@%%%%%%-
.%@%%@%%%@%@%%@@@%@@@%%%%%%@
#@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@:
+@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@#
@@@@@@@@@@@@@@@@@@@@@@@@@
%@@@@@@@@@@@@@@@@@@@@@.
@@@@@@@@@@@@@@@@*
=@@@@
@@@@@
-@@@@@
.@@@@@@*
*@@@@@@@*
@@@@@@@-
@@@@@
@@@@:
@@@# @@@@@
-@@@@@@@= *@@@@@@-
@@@@@@@@@@@@@@@@@@@
+@@@@@@@@@@@*
Total characters: 6328
Time to execute: 0.005139827728271484
x: 112 | y: 56
Of course, other images can be used as input as well.