function changePixel(r, g, b, a) {
      let pixVal = Math.round((r + g + b) / 3);
      hist[pixVal]++;
      return [r, g, b, a];
    }