make
There is a 121 byte version provided by the author. See Alternate code below.
The current status of this entry is:
STATUS: INABIAF - please **DO NOT** fix
For more detailed information see 2014 maffiodo2 bugs.
./prog arg
./try.sh
This shorter version is provided by the author. It has a fixed ramp and so not as fun but it’s 121 bytes instead of 140.
make alt
cat image.rgb | ./prog.alt
On the face of it :-) given what this program does one might wonder what makes this winning entry special. But when you realize the source is small enough for posting to social media that has a small size limit.
Who will be the first to tweet this source? How many re-tweets will such tweet get? And how many people will really understand the tweet?
Judges’ 2023 update: Last year we would have referred to a toot, as in a Mastodon toot. This year we might have mentioned the term publish although we remain fond of the historic Mastodon term, toot.
This program convert an image to an ASCII ART. The program reads a raw RGB image
from stdin
and print the ASCII ART to stdout
.
The build process will raise some warnings about:
The program will crash if run without parameters.
If you have a terminal geometry than is different from the common 80x25 you can modify the output width by changing the value of the first variable:
=80, d
Type this:
cat image.rgb | ./prog " .:;Y0"
You can use your own image. Convert the image to a raw RGB image. Using ImageMagick it’s very simple:
convert -geometry 80x source.jpg image.rgb
This program require one parameter or it will crash. The parameter of the program is the conversion ramp. You can use different ramps or create your own (for example using some letters of your name).
These are some ramps you can try:
./prog " :1"
./prog " .:;Y0"
./prog " .:-=+*#%@"
./prog " .,:!-iots&8%#@$"
An alternative version of this program is only 121bytes long:
=80,e,j;g(){j+=getchar();}main(){for(;;){j=0;g();if(j<0)break;g(g());putchar(" .:#@"[j/3*5>>8]);if(!(++e%d))puts("");}} d
This alternative version has a fixed ramp. It’s smaller but it’s not so fun to use…