code: protected void drawForegroundToBackground() {
          if (backgroundColor == null) { return; }
  
          final BufferedImage backgroundBufferedImage = new BufferedImage(dimension.width, dimension.height, this.bufferedImage.getType());
          final Graphics graphics = backgroundBufferedImage.getGraphics();
  
          // draw current color
          graphics.setColor(backgroundColor);
          graphics.fillRect(0, 0, dimension.width, dimension.height);
          graphics.drawImage(bufferedImage, 0, 0, null);
  
          // draw back to original
          final Graphics graphics2 = bufferedImage.getGraphics();
          graphics2.drawImage(backgroundBufferedImage, 0, 0, null);
      }
docs: create background, then draw current word cloud on top of it.
  Doing it this way preserves the transparency of the this.bufferedImage's pixels
  for a more flexible pixel perfect collision