title: How do I load an enormous image to Java via BufferedImage?
body: <p>I want to load large images (18000 x 18000) to my application.   If i use <code>BufferedImage</code> with type <code>int_rgb</code>, I need around 1235mb of heap memory to load.  This is a very high amount of memory, and end users will likely have less ram  (1GB or less).</p>
  
  <p>On my development PC, when I load the image from MyEclipse IDE, it throws an out of memory <code>Exception</code>.  When i pack my code to an executable jar and run it on my PC external of Eclipse, it still throws an exception. </p>
  
  <p>How do I load such a large image into my application using buffered image without using 1235mb of memory?  Is there a trick, like splitting the image into smaller portions like image segmentation?</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/6691915/out-of-memory-problem-saving-large-bufferedimage">this thread on SO</a>, but it not useful for me; I want to load the image into <code>BufferedImage</code> and then draw it on a <code>Panel</code> using the <code>Graphics</code> class.</p>