public default void diffuse(long[][] frame, int x, int y, long newColor, int dx, int dy, int num, int denum) {
    int nx = x + dx;
    int ny = y + dy;
    if (nx >= 0 && nx < frame[0].length && ny >= 0 && ny < frame.length) {
      for (int c = 0; c < 3; c++) {
        int cError = ((ColorUtil.getComponent(frame[y][x], c) - ColorUtil.getComponent(newColor, c))*num)/denum;
        frame[ny][nx] = ColorUtil.addToComponent(frame[ny][nx], c, cError);
      }
    }
  }