title: Is multiplying a BufferedImage to set brightness the right thing?
body: <p>This is a question, wether I am using the right way or not. And by the right way, I mean, is there a more memory-efficient way to do this?</p>
  
  <p>I use 1 image source:</p>
  
  <pre><code>String imgurl = "imgreadertest8.png";
    BufferedImage loadedimage = ImageIO.read(getClass().getResource(imgurl));
    BufferedImage image = ImageIO.read(getClass().getResource(imgurl));
  </code></pre>
  
  <p>I draw the image in a paint() method. But sometimes I need to set the brightness:</p>
  
  <pre><code>public void setBrightness(float brightness)
  {
      RescaleOp rescaleOp = new RescaleOp(brightness, 15, null);
      rescaleOp.filter(loadedimage, image);
  }
  </code></pre>
  
  <p>So I read the same image, two times. One to have a 'final' BufferedImage (it's not really final... But I cannot use final in this context, because it needs to be used outside the constructor (which you can't see here, but it is)) which is used as template, and one to edit and draw.</p>
  
  <p><strong>More information:</strong> Before trying this way, I did this:</p>
  
  <pre><code>String imgurl = "imgreadertest8.png";
    BufferedImage loadedimage = ImageIO.read(getClass().getResource(imgurl));
    BufferedImage image = loadedimage;
  </code></pre>
  
  <p>But when I edit the image, it edits the loadedimage as well. Pretty much because they're the same object.</p>
  
  <p>So... Is there another way to set the brightness of this image, WITHOUT loading the same image two times?</p>