private void propagate(int i, int j, double value) {
		
		if ((i<0)||(j<0)||(i>=img.getWidth())||(j>=img.getHeight())) {
			return;
		}
		
		if (nearestArr[i][j] > value) {
			nearestArr[i][j] = value;
				actions.add(new PopulateAction(i-1, j, value+1));
				actions.add(new PopulateAction(i+1, j, value+1));
				actions.add(new PopulateAction(i, j-1, value+1));
				actions.add(new PopulateAction(i, j+1, value+1));

				actions.add(new PopulateAction(i-1, j-1, value+SQRT_2));
				actions.add(new PopulateAction(i-1, j+1, value+SQRT_2));
				actions.add(new PopulateAction(i+1, j+1, value+SQRT_2));
				actions.add(new PopulateAction(i+1, j-1, value+SQRT_2));
			
		}
		
	}