def get_neighbors(n_row, n_col, i,j):
  """
  Get neighboring pixel coordinates
  """
  neighbors = []
  if i != 0:
    neighbors.append((i-1, j))
  if i != n_row - 1:
    neighbors.append((i+1, j))
  if j != 0:
    neighbors.append((i, j-1))
  if j != n_col - 1:
    neighbors.append((i, j+1))
  return neighbors