WritableRaster problems

I don’t know why but when I try to paint the manipulated image nothing has changed.

private void render(Graphics2D g2d){
        
        WritableRaster wr = lithosphere.getRaster();
        
        int lookup;
        
        double mapHeight;
        
        double[] k = {0,0,0}, data;
            
        for (int x = 0; x < WIDTH; x++) {

            for (int y = 0; y < HEIGHT; y++) {

                mapHeight = (map[x][y].getHeight() <= 650) ? 650 : map[x][y].getHeight();

                lookup = (int)(mapHeight / 650) - 1;

                data = heightmap_raster.getPixel(lookup, 0, k);

                wr.setPixel(x, y, data);

            }

        }
        
        g2d.drawImage(lithosphere, 0, 0, null);
        
    }

The raster is changing but when I go to draw the image nothing is drawn. The image stays the same. Any ideas?

Oh and I didn’t know where this was supposed to go. And please do not give me a link to something. I’ve been on this for a while and still can’t figure it out.