title: Java save image pixels into an array & draw image
body: <p>I am working on a game where you only download the jar, and when you download the jar, the game will download the new cache.</p>
  
  <p>Meanwhile I want to show a nice background, without loading it off a link, I've thought of this idea, I am not sure if it is possible though.</p>
  
  <p>Every image is loaded and is being drawn pixel by pixel, is it possible to get ALL pixels colors of an image, width, height and then print the values &amp; then put them in an array eg:</p>
  
  <pre><code>public int[] imagePixels = new int[]{PUT PIXELS HERE...};
  </code></pre>
  
  <p>And then simply use a method to draw that background? Is that possible to do?</p>
  
  <p>Are there any better solutions for this like packing the image into the jar or something?</p>
  
  <p>Explanation:</p>
  
  <p>You have an image, I want to load that image and load every single pixel, we start from row 0, by width &amp; height.</p>
  
  <p>I want to collect every single pixel and save it into an image, so then I can load the image without using any file, and just draw the pixels off the array.</p>