public Picture getImage() {
    Color[][] col = new Color[h][w];
    Color c;
    int r=0;
    int g=0;
    int b=0;
    for (int i=0; i<green.length; i++) {
      for (int j=0; j<green[0].length; j++) {
        for (int k=0; k<green[0][0].length; k++) {
          if (green[i][j][k]==1)
          {
            g = k;
            for (int m=0; m<red[0][0].length; m++) {
              if (red[i][j][m]==1) {
                r = m;
              }
            }
            for (int n=0; n<blue[0][0].length; n++) {
              if (blue[i][j][n]==1) {
                b = n;
              }
            }
            c = new Color(r,g,b);
            col[i][j] = c;
          }
        }
      }
    }
    Picture pic = new Picture(col);
    return pic;
  }