User Tools

Site Tools


ascii_art

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
ascii_art [2023/03/25 15:37] – [Step 2. Load your image’s pixel data into a 2-dimensional array] frchrisascii_art [2023/03/26 09:44] – [Step 5. What if it looks your image looks squashed?] frchris
Line 158: Line 158:
 import javax.imageio.ImageIO; import javax.imageio.ImageIO;
 /** /**
- Test your Step2 code with this. It reads your 2D array of Color + Start Step2 with this code 
- * and draws it.+ * The image will return a single line of ints that represent color 
 + * and you need to make a 2D Array of Color from it.  
 + *
  * @author Chris Thiel, OFMCap  * @author Chris Thiel, OFMCap
  * @version 25 Mar 2023  * @version 25 Mar 2023
Line 302: Line 304:
  
     }     }
 +    public int[][] getBrightness() 
 +    { 
 +        return brightness; 
 +    }
     public static void main(String[] args) {     public static void main(String[] args) {
-        Step3 pic= new Step3("StBernardSm.jpg"); // change this to the picture you picked +        Step3 pic= new Step3("MyPicture.jpg"); // change this to the picture you picked 
-        JFrame window = new JFrame("Step 2 Tester");+        JFrame window = new JFrame("Step 3");
         window.setSize(pic.getWidth(), pic.getHeight());         window.setSize(pic.getWidth(), pic.getHeight());
         window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Line 315: Line 320:
 </code> </code>
 ==== 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.+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.
  
  
-==== Step 5. What if it looks your image looks squashed? ====+==== Step 5. What if it looks your image looks stretched or squashed? ====
  
  
 [[https://robertheaton.com/2018/06/12/programming-projects-for-advanced-beginners-ascii-art/|This is from Robert Heaton's Advanced Beginners Projects]] [[https://robertheaton.com/2018/06/12/programming-projects-for-advanced-beginners-ascii-art/|This is from Robert Heaton's Advanced Beginners Projects]]
ascii_art.txt · Last modified: 2023/03/27 10:46 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki