This programme comverts a bitmap image to an ASCII art. It uses a C library that I wrote to read the bmp image data, then maps each pixel to an ASCII character. I have done a couple of iterations of this project, including an animated version. This project is nothing but a practice, and I am well aware of the fact that this could have been done in 2 minutes using p5.js or processing. I just tried to have fun doing this in extremely low level.
..
. .,,,, -,
., -=- .,:,.,:- -. .
~*=..:. ~~~-,..
...,.-. =*!!=;-.
.. . ,: :*!!!!*!:,
:~..~, .-=!!!!!!!**:
.:- .~ .,==;===!!!!*;
,~ ~=;;;;;=!!!*;
,. .;=;;;;;;;=!!*:
,- .~,~====;;;;=!!*-
:, .. :*!!!=;;;=!!=.
.:~ ,;=**!!;;;=!*-
. .;. . ,, ,~=*!=:;!*;
,, ,:~. -, .:*!;;=!!.
:... :, .. .: .. :!!:;!*~
,:- -~ .~, ,:,. ;!;;!*:
,;: ~-..-:-~~~, *: ,*!:=*;
,. -~:,..... .. ,. =*;=*;
...., .=: ~!;;!;
.. .;:- .:;=!!!!!!- :!;;==,
.. -:. ;!;:;::;!- :==;;=,
.- :! .!- .!!!!:
~!. .!, =!!!:
,*, ,!,..;!!!~
.!- .!,::~!!!-
.. . .!;;=;::=;==;==!:
.==;;;;;;;;;;=- =!=;=!!=!!!===!=.
:!=========!=. ;!-.~~===!!====!-
.!!!!!!!!!!!: ,~,-:--;;!!!====!,
.=!!!!!!!!!!~ ::-=!=~,;!!!=====
=!==!!!===!- :--!!!:,;=====;=;
;=;;=!!:;;!. :~-;!=-:;==!===!!~
:=:;;;=;:;=,.-!-,~--:!=;=;;=!!!,
.==;, ,===-...~:=~,!~-!====~;!!;
,:~ -:- -:~~- -~,:~ ..,,
..,
.-~~-,.
,--,,,,,-..,
~:,.,..,,,,-~~
~~-,.......,,,~
~-,........ .,.,,
.:,. ....... ...:.
.~..-:;~-,,,,. .:.
-- ~!==;;:::~,..,:
-,,!!;;;;;::::, ,-
.~;!=;;::::::;~.,,
-~;!!=;:;;;::;~.,,
:~;=:~~~:~-,-~~-,,
-~--. .,,.. ..-~.,
.-~:,,.~~,,,,-:,..
-;=;:-::,-~:~:-,.
,=;;~~;;-,~~~:-~
.==-,~;:~,,~;:--
;;,,..,..,,:~,
~- .,,.,,..,,.
,..,,:::-,,.,.
...~~-~--~,..,.
..~;::~~-... ,
. ,~-,--. ,, --
-: ,,.,,..~-.:=~.
..,,!*. .,.. -:,,;;=:~~,
,;=;-~*;-- ..-:-,:;:::==;--.
~!!;~:!*~,=~,,-~~,-:::~::;;:==,
,*!;:;=!*: ~;~-~~,,~~::~~~-:;=;;~.
.:!;:~!!**=..~~~-----~:~~:~~-;=::;;
-=:!;~:!!*;~, -~~~~--~:;:::~~:=:;:~:
~*;;;~-:!*!;:~..-::--~~:;:::~~;;::,~~
:!*;:;-,:!#=;=~~..;:--~~;;:::~~;:~-~;;
;=!=--;-,;!*::=:;~.:~~:~:=::;:~~:~~~~:;
:!!=---:~-;!;-~:;;:::,:=:;::::~,~:~~~-~;
==*;,--~-:==:,::::~~,-;:-~~~~---:~:~~-~;
;!=~-~,,-:;!:-::~::~-~;~-~~~~--:~-:~~-~:
This works only in Unix-like operating systems (WSL works). Compile the project with make
, and run it:
$ make
$ ./a.out
You can change the image you wanna use in main.c
. Why not use command line arguments? Too lazy.