ascii_art
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ascii_art [2023/03/26 11:21] – [Step 4. Convert brightness numbers to ASCII characters] frchris | ascii_art [2023/03/27 10:46] (current) – frchris | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== ASCII Art ====== | ====== ASCII Art ====== | ||
+ | [[https:// | ||
< | < | ||
Line 38: | Line 39: | ||
==== Step 0. Choose an image ==== | ==== Step 0. Choose an image ==== | ||
- | Choose the first image that you want to convert into ASCII art. It’s good to start with an image around 640x480. | + | Choose the first image that you want to convert into ASCII art. It’s good to start with an image around 640x480 |
+ | |||
+ | Light pixels will be represented by small characters like a dot (.), which leave lots of the background exposed. On the other extreme, dense characters like $ are used to cover up the background. | ||
<code PickPicture.java> | <code PickPicture.java> | ||
import java.awt.Color; | import java.awt.Color; | ||
Line 320: | Line 324: | ||
</ | </ | ||
==== Step 4. Convert brightness numbers to ASCII characters | ==== Step 4. Convert brightness numbers to ASCII characters | ||
- | You can experiment with different ways to map brightnesses to characters, but a good place to start is the string in the starter code. The characters in it are ordered from thinnest to boldest, which means lightest to darkest. | + | You can experiment with different ways to map brightnesses to characters, but a good place to start is the string in the starter code. The characters in it are ordered from thinnest to boldest, which means lightest to darkest. |
<code Step4.java> | <code Step4.java> | ||
Line 419: | Line 423: | ||
Characters tend to be three times taller than wide, so you could replace each character with three. If that is too large, you could make one character represent the average of three columns. | Characters tend to be three times taller than wide, so you could replace each character with three. If that is too large, you could make one character represent the average of three columns. | ||
+ | ==== Here are some examples ==== | ||
+ | - {{ ::fry.txt |}} | ||
+ | - {{ :: | ||
+ | |||
+ | |||
+ | ==== See more from Robert Heaton Here ==== | ||
[[https:// | [[https:// |
ascii_art.1679844101.txt.gz · Last modified: 2023/03/26 11:21 by frchris