ascii_art
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
ascii_art [2023/03/25 15:31] – [Step 3. Convert the RGB tuples of your pixels into single brightness numbers] frchris | ascii_art [2023/03/25 15:37] – [Step 2. Load your image’s pixel data into a 2-dimensional array] frchris | ||
---|---|---|---|
Line 152: | Line 152: | ||
==== Step 2. Load your image’s pixel data into a 2-dimensional array ==== | ==== Step 2. Load your image’s pixel data into a 2-dimensional array ==== | ||
<code Step2.java> | <code Step2.java> | ||
+ | |||
import java.awt.image.BufferedImage; | import java.awt.image.BufferedImage; | ||
import java.io.File; | import java.io.File; | ||
import java.io.IOException; | import java.io.IOException; | ||
import javax.imageio.ImageIO; | import javax.imageio.ImageIO; | ||
+ | /** | ||
+ | * Test your Step2 code with this. It reads your 2D array of Color | ||
+ | * and draws it. | ||
+ | * @author Chris Thiel, OFMCap | ||
+ | * @version 25 Mar 2023 | ||
+ | */ | ||
public class Step2 | public class Step2 | ||
{ | { | ||
Line 309: | Line 315: | ||
</ | </ | ||
==== 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 below. The characters in it are ordered from thinnest to boldest, which means lightest to darkest. | ||
+ | |||
+ | |||
==== Step 5. What if it looks your image looks squashed? ==== | ==== Step 5. What if it looks your image looks squashed? ==== | ||
[[https:// | [[https:// |
ascii_art.txt · Last modified: 2023/03/27 10:46 by frchris