title: Raster Format Exception (Y+height)
body: <pre><code>    width = 25;
      height = 25;
  
      h1Walking = new BufferedImage[6];   
          BufferedImage sprite1 = ImageIO.read(new File(getClass().getResource("/Resources/kirbywalk.gif").toURI()));
          for(int i = 0; i &lt; h1Walking.length; i++){
              h1Walking[i] = sprite1.getSubimage(
                      i * width + i,
          0,
          width,
          height
                  );
          }
  </code></pre>
  
  <p>The code I have placed above is the part that is returning the error in my program. I don't understand why it is doing this does anyone have any idea's why it is returning the error below?</p>
  
  <pre><code>java.awt.image.RasterFormatException: (y + height) is outside of Raster
      at sun.awt.image.BytePackedRaster.createWritableChild(BytePackedRaster.java:1312)
      at java.awt.image.BufferedImage.getSubimage(BufferedImage.java:1196)
      at Main.Horses.&lt;init&gt;(Horses.java:72)
      at Main.HorseRacingGame.run(HorseRacingGame.java:113)
      at java.lang.Thread.run(Thread.java:695)
  </code></pre>