public void renderCenteredImage(ImageLoader image) {
    int xp = width / 2 - image.width / 2;
    int yp = height / 2 - image.height / 2;
    for (int y = 0; y < image.height; y++) {
      int yt = y + yp;
      for (int x = 0; x < image.width; x++) {
        int xt = x + xp;
        if (0 - image.width > xt || xt >= width || 0 - image.height > yt || yt >= height) {
          break;
        }
        if (xt < 0) {
          xt = 0;
        }

        if (yt < 0) {
          yt = 0;
        }
        int colour = image.pixels[x + y * image.width];
        pixels[xt + yt * width] = colour;
      }
    }
  }