Image bg = Game.getLevel().getBG(); if(bg != null) { BufferedImage bimg = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics bimgg = bimg.getGraphics(); for(int x = 0; x < getWidth(); x += bg.getWidth(null)) { for(int y = 0; y < getHeight(); y += bg.getHeight(null)) { bimgg.drawImage(bg, x, y, null); } } g.drawImage(bimg, x, y, null); }