public void setPixel(int x, int y, short red, short green, short blue) {
    short[] values = new short[] {red,green,blue};
    if (inRange(red) && inRange(green) && inRange(blue)){
      for (int i = 0; i < imageArray[y][x].length; i++){
        imageArray[y][x][i] = values[i];
      }
    }
  }