title: Having trouble rendering 2 images side-by-side the original images being altered
body: <p>I'm trying to create a program that can open two jpegs with the same dimensions, and create a new jpeg that has those two images placed side-by-side with no change to wither image.  </p>
  
  <p>The code that creates the new image is this:</p>
  
  <pre><code>public static Picture sumPicturesHorizontally(Picture left, Picture right) {
  
      BufferedImage newImage = new BufferedImage(
              left.getWidth() + right.getWidth(), 
              left.getHeight(), 
              left.getImage().getType());
  
      Graphics2D g = (Graphics2D) newImage.getGraphics();
      g.drawImage(left.getImage(), 0, 0, null);
      g.drawImage(right.getImage(), left.getWidth(), 0, null);
  
      Picture p = new Picture(newImage);
      return p;
  }
  </code></pre>
  
  <p>(Picture just my a wrapper class that contains a BufferedImage and that image's dimensions)</p>
  
  <p>For the most part, this works.  However, the image that's output isn't just the left and right images side-by-side, it seems that something is modifying the border between the left and right images.</p>
  
  <p>I have a yellow square, and a red square; my source images are 1 constant color.  The sum image, however, has some artifacts around the new border that aren't in the original.  Here's a zoomed-in screenshot of what I'm talking about: 
  <img src="https://i.stack.imgur.com/tvm7A.png" alt="enter image description here"></p>
  
  <p>If I zoom to the same level on my source images, I don't see the same artifacts on the edges. I'd like it to be just yellow to the edge, then just red.  There should'nt be different shades of yellow and red.  Is there some config to make it behave this way, or a different method of rendering?<br>
  Also, I don't normally work with graphics, is there a name for what this edge blending is called?  Thanks for the help!</p>