Have done this purely for the fun of it. The project uses 70 ASCII characters to generate an ASCII ART image from the bitmap. The ASCII ART image is actually a label with the label's text set to the ASCII string that was generated from the bitmap (image on the left). Have used a text size of 2 for the label and have set the typeface to MONOSPACE. Note that the project uses inline Java code and you will need a B4A version that supports inline Java code to run the project (with the JavaObject library enabled).
This is a very oversimplified way of doing it - have just used the average of each pixel's RGB values to decide upon the ASCII character to be used for each pixel. Thus, every pixel in the bitmap is represented by an ASCII character in the ASCII ART image.
I have done this on a 7" tablet so that the display can fit the ASCII image. The image can be reduced if one for eg take blocks of let's say 5 x 5 pixels and work out what character would best represent the 5 x 5 pixels. It can get quite scientific and will involve far more math calcs than the simple approach that I have followed here. But nevertheless, it was an interesting exercise...
The ASCII ART image is not wonderfully clear but at least one can catch the drift. By following other techniques some wonderful results can be obtained.
This is a very oversimplified way of doing it - have just used the average of each pixel's RGB values to decide upon the ASCII character to be used for each pixel. Thus, every pixel in the bitmap is represented by an ASCII character in the ASCII ART image.
I have done this on a 7" tablet so that the display can fit the ASCII image. The image can be reduced if one for eg take blocks of let's say 5 x 5 pixels and work out what character would best represent the 5 x 5 pixels. It can get quite scientific and will involve far more math calcs than the simple approach that I have followed here. But nevertheless, it was an interesting exercise...
The ASCII ART image is not wonderfully clear but at least one can catch the drift. By following other techniques some wonderful results can be obtained.
Attachments
Last edited: