title: Copy specific part of a bufferimage into another bufferimage
body: <p>I have one big buffer image.</p>
  
  <p>I want to create another buffer image with the data from the first one</p>
  
  <p>I tried making a <code>raster</code> with <code>buffer.getData(new Rectangle(x,y,width,height))</code></p>
  
  <p>And then <code>buffer2.setData(raster)</code></p>
  
  <p>But from reason the data is translated by x,y instead of being 0,0.For example if I have a pixel at x,y in the original I will still have it at x,y in the new one instead of 0,0 because the x,y is where the rectangle is translated.</p>
  
  <p>So is there a way to translate the raster properly OR is there a better solution to copying the image?</p>
  
  <p>Edit: I also managed to do it with <code>getGraphics().drawImage()</code>. There is a method for defining 2 rectangles by defining their corners. But the method below is better because it does not overdraw.</p>
  
  <p>Edit2: Seems like  the subimage is connected to the original,is there another way to create a bufferimage with the cut data and dimensions that are actually original?</p>