[Question]
  [
### Background
Being in a philosophical mood, I remembered one old idea. I think it is suitable for CG.
Duplicates are not found, but it's of course just a kind of totalistic cellular automaton or [erosion](https://en.wikipedia.org/wiki/Erosion_(morphology)).
Given an infinite board filled with empty (let `0`) cells. We create *a figure* - a finite set of non-empty (let `1`) cells. Figure may be with holes, disconnected, random etc. But the bounding box of the figure is finite.
We call *the border* of a figure a subset of its cells that have at least one empty neighbor
(in this model we use *4 neighbors*: top, left, right, bottom).
Example of border (blue):  
[![enter image description here](https://i.stack.imgur.com/NikPm.jpg)](https://i.stack.imgur.com/NikPm.jpg)
One step of fading algorithm:
1. Define a figure boundary
2. Eliminate it, replacing by empty cells
Example of fading step:  
[![enter image description here](https://i.stack.imgur.com/ZUEpG.jpg)](https://i.stack.imgur.com/ZUEpG.jpg)
### Task:
Determine how many described steps it takes to completely disappear a given figure.
### About size of board
Since the figure can only fade, we just have to deal with the board, just one strip padding figure' bounding box.  
**UPD - About minimal input**  
So strictly speaking the minimal board is `[[0, 0], [0, 0]]` - empty board with no figure. And as mentioned in comments, you may not handling an empty array; sorry that made that point clear just now.
### Input:
Figure in any appropriate form:
* binary array (all board)
* array of strings (too)
* sparse array (list of positions of non-empty cells and dimensions)
### Output:
Non-negative number of steps, totally eliminating a figure.
### Notes:
Of course, the literal passage of the algorithm to fixed point
and counting steps is an acceptable solution.
But I've got at least two addition ideas:
* Some built-ins of Mathematica ;)
But I can't configure it properly (
* Perhaps one can analyze the maximum distances to the border,
and get the answer only by a given array
### Test cases:
```
[[0, 0], [0, 0]] → 0
[[0, 0 ,0], [0, 1, 0], [0, 0, 0]] → 1
[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 
 [0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0],
 [0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0], 
 [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0],
 [0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0], 
 [0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] → 3
Example of string input:
00000000
01111110
01111110
01111110  → 3
01111110
01111110
01111110
00000000
Example of sparse array input (dimensions and non-empty cells):
[16, 16], 
[[2, 2], [2, 3], [2, 4], [2, 13], [2, 14], [2, 15], [3, 2], [3, 3], [3, 4], [3, 5], [3, 8], [3, 9], [3, 10], [3, 12], [3, 13], [3, 14], [3, 15], [4, 2], [4, 3], [4, 4], [4, 5], [4, 8], [4, 9], [4, 10], [4, 12], [4, 13], [4, 14], [4, 15], [5, 3], [5, 4], [5, 5], [5, 8], [5, 9], [5, 10], [5, 12], [5, 13], [5, 14], [6, 8], [6, 9], [6, 10], [7, 7], [7, 8], [7, 9], [7, 10], [8, 7], [8, 8], [8, 9], [8, 10], [9, 7], [9, 8], [9, 9], [9, 10], [11, 2], [11, 3], [11, 4], [12, 2], [12, 3], [12, 4], [12, 5], [12, 6], [12, 7], [12, 8], [12, 9], [12, 10], [12, 11], [12, 12], [12, 13], [12, 14], [13, 2], [13, 3], [13, 4], [13, 5], [13, 6], [13, 7], [13, 8], [13, 9], [13, 10], [13, 11], [13, 12], [13, 13], [13, 14], [13, 15], [14, 3], [14, 4], [14, 5], [14, 6], [14, 7], [14, 8], [14, 9], [14, 10], [14, 11], [14, 12], [14, 13], [14, 14], [14, 15], [15, 13], [15, 14], [15, 15]] → 2
```
  
[Answer]
# [Python 2 or 3](https://docs.python.org/), 69 bytes
```
f=lambda c:c>[]and-~f([s for s in c if sum(1==abs(e-s)for e in c)>3])
```
A recursive function that accepts a list of positions on the Cartesian grid represented as complex numbers and returns the fading count. Returns `False` for zero as it [quacks like zero in Python](https://codegolf.meta.stackexchange.com/a/9067/53748).
**[Try it online!](https://tio.run/##1VVLjptAEN1zit4NJExEmQbDSMxFEBphDAmWjRFgaZJFdtnlCMnl5iIO3V2vZ2w5jiNlE9RSPerzqmleq/rP06d9Fx6PTbYtd6t1KaqH6jEvym59/7Vx81E0@0GMou1EJdpGjIedS1lWrka3vh89Fax10HsMC@@4rhtR7ffDenR35TS0z96DI@ZnqKfD0Im8fU@bdxvN2aqyoew@1u627pDu6djmUiwPijk874Ff2yLfFIXjTPU4jU@lyESue@WFb2we@CIQflD4QkGa3xiqVZyk3bjmel0EQrMu5r5GudFpzVnluf9yo@vrHzb6iy@6@ej@cN5XNk//T/j2D79Ieu4NrmzgN33nK6GcfDGeVupe5AtfLJT2ZxuylWwJDrKeSIGQS0IuCblktognbFO2FACgklBKqDXkksklk0sml0wumVwyuQS5BLkEuQS5BHnEpBGTRkwaMWnEpBFII5BGII1AGnNNzDUxapa@WLJN2KZsTULCCQknJJyQICHlhJQTUk5IkUDEp6RACKC3RfihhD9KizehCCAGWAIkACkAN1OILLLkZNnNgRB0QRAGQRkEaSgQAywBEoAUgDuHtrOVDlntUPi2s/nBBNkQdEMQjgIxwBIgAUgBuLW0ra2wyCqLrLTIaousRMhqRKPIjiJ14XgGTmacTWqc8ZhC1oey7@tu7Z6MRN9MPnNxC89x6ue@rqZyaved5jX3P9RLq8NxdIO5wBcmuV4rii9t7@o@cBsOHsdlNR3K7UzY6CRPO/uh7SbXhHxx9/Lz@8uPb3e5cWQZ2Ocp/ws "Python 3 – Try It Online")**
[Answer]
# [MATLAB](https://www.mathworks.com/products/matlab.html) with Image Processing Toolbox, ~~45~~ 29 bytes
```
@(x)max(max(bwdist(~x,'ci')))
```
Anonymous function that inputs a matrix and outputs a number. [**Try it online!**](https://tio.run/##y08uSSxL/Z9mq6en999Bo0IzN7FCA4STylMyi0s06ip01JMz1TU1Nf@naUQb6CgYWCuAyFhNLigfJmQIl0OXJgbBjIAgrGoQsqiK0bSgi2NTjAtRYjIxbiYWQYNPAS8EmqhgCIboUlBRhAJDZGGEGFEKDHAqMIApwLAZ1ZHo0jRVQFJAYSjABgkqQAsoPAqwQYIKoDBW8z8A) (with Octave).
### Explanation
The code
1. computes the Manhattan (city-block) distance between each value and the nearest zero (`bwdist(..., 'ci')` applied to `x` negated);
2. takes the maximum (`max`, used twice because the image has two dimensions).
[Answer]
# MATLAB with Image Processing toolbox, ~~59~~ 66 bytes
*+7 bytes from @Luis Mendo*
```
I={@(~)0,@(a)1+G(imerode(a,strel('dis',1)))}
G=@(a)I{2-~nnz(a)}(a)
```
Writing recursive code in MATLAB is surprisingly tricky; I'm using a workaround I found at [this link](https://stackoverflow.com/questions/32237198/recursive-anonymous-function-matlab) to simulate an if-else statement inside of an anonymous function.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 15 bytes
```
k□ẊṠ?Fv¨VεƛṠg;G
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCJr4pah4bqK4bmgP0Z2wqhWzrXGm+G5oGc7RyIsIiIsIltbMSwxXSxbMCwxXSxbMSwwXSxbMiwxXSxbMSwyXV0iXQ==)
Takes input as a list of coordinates.
Computes the taxicab distance of each point to the border and take the maximum.
```
k□ẊṠ?Fv¨VεƛṠg;G
k□              # push [[0,1],[1,0],[0,-1],[-1,0]]
  Ẋ             # cartesian product with input
   Ṡ            # vectorizing sum, this results in the shape inflated by one
    ?F          # remove all those that are in input, this results in the border of the shape
      v¨Vε      # vectorized and right vectorized absolute difference
          ƛ  ;  # map:
           Ṡ    #   vectorizing sum
            g   #   minimum
              G # maximum
```
### 15 byte alternative
```
ÞT?0ÞIv¨VεƛṠg;G
```
Takes input as a list of lists.
[Answer]
# [MATL](https://github.com/lmendo/MATL), 15 bytes
```
`t4&3ZItb-z}x@q
```
Inputs a binary matrix and outputs a number. [**Try it online!**](https://tio.run/##y00syfn/P6HERM04yrMkSbeqtsKh8P//aAMdBWKRNYg0hCGsahCyqIrRtKCLY1OMC1FiMjFuJhbFAgA)! Or [**verify all test cases**](https://tio.run/##y00syfmf8D@hxETNOMqzJEm3qrbCofC/S8j/aAMdBQNrBRAZywXmwPiGcAkUOWIQTD8EYVWDkEVVjKYFXRybYlyIEpOJcTOxCBR2Cngh0DgFQzBEl4KKIhQYIgsjxIhSYIBTgQFMAYbNqI5El6apApICCkMBNkhQAVpA4VGADRJUAIWxAA).
### Explanation
The program erodes the image until it doesn't change.
```
`         % Do...while
  t       %   Takes input (implicitly) the first time. Duplicate. Call this (*)
  4&3ZI   %   Erode using 4-neighbourhood
  t       %   Duplicate
  b       %   Bubble up: moves (*) to the top of the stack
  -       %   Subtract, element-wise
  z       %   Number of non-zeros. Gives 0 if the last erosion didn't modify
          %   the image. Call this (**)
}         % Finally (this code is run on loop exit)
  x       %   Delete the image
  @       %   Push number of current iteration (which is the last one)
  q       %   Subtract 1
          % End (implicit). A new iteration will be run if the top of stack (**)
          % is not 0
          % Display stack (implicit)
```
[Answer]
# [Julia 0.6](http://julialang.org/), ~~62~~ 48 bytes
```
!m=any(m)&&1+!(conv2(1m,[0 1 0;1 1 1;0 1 0]).>4)
```
[Try it online!](https://tio.run/##yyrNyUw0@/9fMdc2Ma9SI1dTTc1QW1EjOT@vzEjDMFcn2kDBUMHA2hBIGlqD2bGaenYmmv8LijLzSnLyNBSd8vNzomM1uVAFDBSAEKLBGszGUAExEigPJoEQWQUXwhBc0FqBC6QXDFGloGLWCHmEGiQ@sgHYIEkG4HYBHhir@R8A "Julia 0.6 – Try It Online")
Performs erosion as 2D convolution with given 3x3 kernel.
14 bytes saved by MarcMush by switching to boolean inputs.
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~44~~ ~~42~~ 41 bytes
-1 not handling empty input
```
Max@#/. 1:>1+#0@Erosion[#,CrossMatrix@1]&
```
[Try it online!](https://tio.run/##zZJPS/NAGMTv/RSBghfzaqfZTXYFJSIeFcFj6WEpigXbStqDEuJXr42Z2Tf4jx48CAvPL7vzzJNsZhE2D3eLsJnPwvb@dHsVnsvh8VGCkzMcDkflZbVaz1fLyTC92NH6Kmyq@XOJ6cH2ppovN@X95HL2sDouh9OD19tZWL7Wg7oepcmoSQdJBzvqtnq76Cs@ivZZTZpEp259qft/2puMr7o@7n8e8PP6hQF7fsHeV/TDnX7zsvh7R9982PWqWoTH8vYpVOu786oKL5O6HqfJeHetbc1YDSu0gbhjW8jYkrElY8uu6tyxelaMBOqEWqHeztzQ3NDc0NzQ3NDc0NzI3MjcyNzI3Mjc0tTS1NLU0tTS1MrUytTK1Mo0Z0/Onlw9RZoUrI7Vs3YCR4GjwFHgJPAUeAo8BV4CgLfUQiZ4fy3oh0J/FOPekRXkgkLgBF7AYS0hUjRHdO8uBMoFFAwoGVA0WsgFhcAJvICTszg5RgcxO8j6k7sfDMUGyg0UnBZyQSFwAi/gaBNHx2AhJgsxWojZQowIYkbeyTbNvzO0T21E8mY6aLZv "Wolfram Language (Mathematica) – Try It Online")
Input a binary array of `0`,`1`s.
I don't think there's a shorter way to generate `{{0,1,0},{1,1,1},{0,1,0}}`.
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 89 bytes
```
s`1.*
$&_
}`(?<=(.)*)1(?=(.)*)(?=.*¶(?<-1>.)*(?(1)^)0|0|(?<=0(?(2)$)(?<-2>.)*¶.+|01))
0
_
```
[Try it online!](https://tio.run/##bYu5DYAwDEV7z4GQHURkUwPZhEBBQUMBlGEtBmCxkHAUkfjNP569jNs0D96vvWgFWW5h79HUDWpSJGieEFyr8wiglDYMaFCoI3bs4jGHXlFGkVeRn4cuHAsRMFjvORWwiLw5prvfy@Nv//TPk/9UFw "Retina 0.8.2 – Try It Online") Takes input as an array of binary strings. Explanation: Loosely based on my original answer to [Flood fill by distance](https://codegolf.stackexchange.com/q/249085/).
```
s`1.*
$&_
```
If there are any `1`s remaining, then increase the iteration count.
```
(?<=(.)*)1(?=(.)*)
```
For each matching `1`, keeping track of its position, ...
```
(?=.*¶(?<-1>.)*(?(1)^)0|0|(?<=0(?(2)$)(?<-2>.)*¶.+|01))
```
...that is either above, to the left, below, or to the right of a `0`, using its captured position and .NET balancing groups in order to locate the relevant digit, ...
```
0
```
... erode one step.
```
}`
```
Repeat until there is nothing left to do.
```
_
```
Convert the final iteration count to decimal.
[Answer]
# JavaScript (ES11), 88 bytes
Expects a binary matrix.
```
f=m=>m>(m=m.map((r,y)=>r.map((v,x)=>(g=d=>d+2?m[y+d--%2]?.[x+d%2]&g(d):v)(2))))?1+f(m):0
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m70kLz8ldcGCpaUlaboWNyPSbHNt7XLtNHJtc_VyEws0NIp0KjVt7YognDKdCiBHI902xdYuRdvIPje6UjtFV1fVKNZeL7pCOwXIUEvXSNG0KtPUMNIEAntD7TSNXE0rA4j5t9g8k_PzivNzUvVy8tM10jSiYzU1udCEog10FAwUdAxidRRATEMgD8oEoVhsOoBqDBV0DEHKDMHKYEwQwqaDSwFuIDEIaBpUhyEMYVWIkI3VQdeApg1dHIsV-BFVrCDWF0QHFBdJgY3LC_i8N6BypHiZ6ECDIAWIJRTpwhOvKFI4dGFqRJGihi5iHUlKaBCpC81eYlyI6cdBoou80CAj5PHEMoosVXUR8JoCOMtBahRYzQUA)
### Commented
```
f =                      // f is a recursive function taking:
m =>                     //   m[] = input binary matrix
m > (                    // test whether m[] is lexicographically greater
  m =                    // than its updated version
  m.map((r, y) =>        // for each row r[] at index y in m[]:
    r.map((v, x) =>      //   for each value v at index x in r[]:
      ( g =              //     g is a helper recursive function taking
        d =>             //     a direction d in [-1 .. 2]
        d + 2 ?          //     if d is not equal to -2:
          m[y + d-- % 2] //       apply dy to y (decrement d afterwards)
          ?.[x + d % 2]  //       apply dx to x
          & g(d)         //       and do a recursive call
        :                //     else:
          v              //       stop and return v
      )(2)               //     initial call to g with d = 2
    )                    //   end of inner map()
  )                      // end of outer map()
) ?                      // if m[] was updated:
  1 +                    //   increment the final result
  f(m)                   //   and do a recursive call
:                        // else:
  0                      //   stop
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~23~~ 11 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ạỊS=5ðƇ`ƬL’
```
A monadic Link that accepts a list of positions, as complex numbers, of non-empty cells and yields the fading count.
**[Try it online!](https://tio.run/##y0rNyan8///hroUPd3cF25oe3nCsPeHYGp9HDTP/H530cOeqw20Pd3cfbv//PzraQEeBWBSro8ClANJgCENY1SFkY3XQ1KPpQhfHtAA/ooIFRPqA6CCKBQA "Jelly – Try It Online")**
### How?
```
ạỊS=5ðƇ`ƬL’ - Link: list of coordinates, C
        Ƭ   - start with X=C and collect up while distinct applying:
       `    -   using X as both arguments of:
      Ƈ     -     filter keep those c in X for which:
     ð      -       the dyadic chain - f(c, X):
ạ           -         (c) absolute difference (X) (vectorises)
 Ị          -         insignificant? -- less than or equal to 1?
  S         -         sum -- number of neighbours + self
   =5       -         equals five?
         L  - length
          ’ - decrement -- as we've counted the empty list that then didn't change
```
[Answer]
# [J](http://jsoftware.com/), 26 bytes
```
_1+[:#(#~4=1#.1=|@-/~)^:a:
```
[Try it online!](https://tio.run/##lU9Ni8JADL3PrwgdWSfWZibiKVopCgsL4mGvwyiLVLQX/4D0r9fRjqDiZR@EfLyXF9J0GQ0PUAoMYQwOJEZBsPpdf3c7zr1oo9tpyZq4vFSFbXErf9Kh2iwJvCzIepmTjXyIdMb2ywy0/FA1xoLeRMFEWVThJ5nJbVtTwNY1vD1RNe2nPl3PbU0eXzgvBoOW2I@sUvX@eIYDmEFDtkrWkFHmZrSbQLi95pSLUI45VfiPtSfcHDjVfDdj7id9Tv0Dn/mX/Td/VN0V "J – Try It Online")
* Takes input as complex numbers
* Create a distance table between each element and all the others
* For each row, count how many values equal exactly 1 (only true for compass adjacency)
* Remove any whose count is not 4 (ie, remove any non-interior elements)
* Continue this process until a fixed point, keeping a list of intermediate results
* Return the length of this list minus 1
## [J](http://jsoftware.com/), alternate, 34 bytes
```
[:>./1<./"1@:#.]|@-"1/&($#:I.@,)-.
```
[Try it online!](https://tio.run/##fY/LCsIwEEX3@YohFU1sO8lIV9FKURAEceE2RBfSot34A9Jfr@lDsKV4YZjXuQNT1hwXBaQGFhCBBuMjRthfTofami0q2qDilJkA3TuLOam5mAXmiFkkY6wlO@8QWtAaT9IkNoKc8Jin5BQmQlXl6GSlS7o@MUu6qQ2qJPW2UOVo5WBnjZAuML5fKsby@@MFBXDkeo23FbjmKc20F9NEfSX/gj9qPNTX1NqJukmX@/6r6f3AP7ovWf0B "J – Try It Online")
Input is a binary matrix.
We do a single calculation on the input, with no transforms, instead of iterating to simulate the fade:
1. Positions of all the ones
2. Positions of all the zeros
3. Manhattan distance between every element of each of those sets
4. Return the largest
[Answer]
# Python3, 177 bytes:
```
E=enumerate
def f(b):
 b=[(x,y)for x,r in E(b)for y,v in E(r)if v]
 c=0
 while b:b=[(x,y)for x,y in b if all((x+X,y+Y)in b for X,Y in[(1,0),(0,1),(0,-1),(-1,0)])];c+=1
 return c
```
[Try it online!](https://tio.run/##rVPLbtswEDyXX7HwJWTNFFqJlCUXPuYfEqhEYbtyI8BRDNlJra93SWmXiZ2icIEShHZIzs7yMdr1h8fnNit23el0t6jbl6e6Wx5q8aPewEau1FzAalHJo@7V5rmDo@6gaeHOr4Rhr1/HYaeaDbw6AetFIuDXY7OtYTU/z@wDdQWeuNxupTxO73U/fVDDZGDc6wfPqCTqRGmZaBy@tyHchjmn3Nf1dIECuvrw0rWwPu26pj3IjaycUiIOqkRDAjpxGgJEPyIYuvvIvbJ7EcGKY/8j723V6Qv@Rdbl/McCf@//ocCVJ7j6is4v9/PTcif9QDfKhSduggUmk0lCTSQ4tH8F1LzSl/1u2xzkzbf2Rp3XDicAjeHlx3MyDH3Yp9insABvgcF@38PeumX7s5aYj9u9mBKjj2EwclWlGtIg6WNG0VBEnsA4YwPIKCWjlIxSfOT1gmJJERMGnImcipw7ihsSNyRuSNyQuCFxQ@KGxQ2LGxY3LG5Y3JKoJVFLopZELYlaFrUsalnUsmhOOTnl5Jwz0zCjWFAsKY6EgggFEQoiFEwoiVASoSRCyQREuqUAMgbDtpAfFPlFMX23ZBnkDGYMCgYlAyoWEEYUxTGqjxeC7AtkYyA7A9kaAeQMZgwKBiUDqpzFytE6GL2D2fvK4wMj2wbZN8jGCSBnMGNQMCgZUGkTS0djYXQWRmth9BZGi2D0yICsc3PxaZ9WR1f1zv@rGP/vfarU6Tc)
[Answer]
# Excel (ms365), 122 bytes
Assuming:
* A range of cells as input;
* Cells contain either a 0 or a 1.
With Excel 365 one could create a named function which can call itself recursively. So let's create a function called 'z' which refers to:
```
=LAMBDA(x,y,IF(OR(x),z(MAKEARRAY(ROWS(x),COLUMNS(x),LAMBDA(r,c,AND(TOROW(INDEX(x,r-{1,0,0,-1},c-{0,1,-1,0}),3)))),y+1),y))
```
Now one could call this function through:
```
=z(<Range>,0)
```
Not sure if I was supposed to add the bytes to actually call the function.
[Answer]
# [Python](http://golly.sourceforge.net/Help/python.html) script in [Golly](http://golly.sourceforge.net/), 83 bytes
```
from golly import*
setrule("4/V")
i=0
while not empty():
 run(1)
 i+=1
show(str(i))
```
Takes input by drawing the figure in Golly.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 29 bytes
```
Ｗ⊙θ⁼⊕⊗×ⅈ⊕ⅈＬΦθ¬›Σ↔Ｅμ⁻ξ§κπⅈＭ→Ｉⅈ
```
[Try it online!](https://tio.run/##TZLBbtswEETv/QoeGYAFuhYpic3JaNogQBwUbQ8FDB8Uh4iFyFIiUWny9aoVzRDWZZ/J3beGNPtD1e@7qpmmf4e6CUqv23f9YtT3l7FqBn3T7vtwDG0MD/qqG@@bU/1TH8Og/@oLo86vTwfzY9RtaB/jQf@omxj62XXXRX3dh2r@@Xs86vX90DVjDHpTPeujUZu6HQf9ZtQ63rQP4U0/GfUMGaynR22616C//qofD/Hi8tPPvm6j/lYNcdl8OU3b7XZl1Gpn1FwzVIsqPJB04mbIMJJhJMPIqfK@RPWo8oXASeGocHaRW8gt5BZyC7mF3EJuKbeUW8ot5ZZyB6mD1EHqIHWQOkodpY5SR2mOmRwzOWcKowrUEtWjLg0lGko0lGgo2eDR4NHg0eDZIIK3NENG@Phbwg8q/KKyOrtyhJxQEEqCJ2DZTJIoySXZlxcizIUwGMJkCKMxQ04oCCXBE7A5S5tTdCRlR7LzzcsHFsZGmBthcGbICQWhJHgCVtu0OgVLUrIkRUtStiRFRFJGPsjtdrvp82vzHw "Charcoal – Try It Online") Link is to verbose version of code. Takes input as a list of points. Explanation:
```
Ｗ⊙θ⁼⊕⊗×ⅈ⊕ⅈＬΦθ¬›Σ↔Ｅμ⁻ξ§κπⅈ
```
While there exists a point in the set with enough near (by taxicab distance) neighbours to survive another iteration, ...
```
Ｍ→
```
... increment the iteration count.
```
Ｉⅈ
```
Output the final iteration count.
30 bytes taking input as a list of newline-terminated strings:
```
ＷＳ⊞υιＩ⌈Ｅυ⌈Ｅι⌊Ｅυ⌊Ｅ⌕Ａν0⁺↔⁻πμ↔⁻ξκ
```
[Try it online!](https://tio.run/##bYzBCoMwEETvfsXiaQMp6NmTFAo9FAL9gtRKXbpGMUnr36fRWlDpXGbfzO5WjR6qTnMI74a4Bjyb3rurG8g8UAhQ3jboJZAoEhVDh0dtHV70SK1vo/dTu0aKSGbTrvBE5l4yo5GQZqmQoNhbLG@2Y@9qjKsRewmtiN0uHiU8xVpFCNlWSZbn@TJP08xz8vWFf/rfb@53/8PhxR8 "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
ＷＳ⊞υι
```
Input the strings.
```
Ｉ⌈Ｅυ⌈Ｅι⌊Ｅυ⌊Ｅ⌕Ａν0⁺↔⁻πμ↔⁻ξκ
```
Calculate the taxicab distance from each point to the nearest `0`, and output the maximum of those.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 28 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
Δ2Fø0δ.ø}2Fø€ü3}εεÅsyøÅs«ß]N
```
Input as a bit-matrix.
[Try it online](https://tio.run/##yy9OTMpM/f//3BQjt8M7DM5t0Tu8oxbEfNS05vAe49pzW89tPdxaXHl4B5A8tPrw/Fi///@jow10FIhFsToKCiD1hjCEVRlCFqgeRTmaJnRxDOPxI4qNJ871RAdOLAA) or [verify all test cases](https://tio.run/##S0oszvifnFiiYKeQnJ@SqpdfnJiUmapgY6Pg6u/GpRRQlFpSUqlbUJSZV5KaopCZV1BaYqWgpON1aLcOl5JjcklpYg5c1B4o5F9aAuX8PzfFyO3wDoNzW/QO76gFMR81rTm8x7j23NZzWw@3Flce3gEkD60@PD/W77/OoW32XCAbucozMnNSFYpSE0G2caXkcyko6OcXlOhDHAal0Nxqo6ACVpuX@j862kDHIFYHTMZygXlQviFMHFkGF4TqAEFUGagYkjxCDRIfTR4dkqIft/343E/Qh3jswO5LJHEc/sCtwgCnCgMsfsFwE5oKQ7qoIC3EMFVgjXeCKtBDDJ8KbJDI9AFOIQA).
**Explanation:**
```
Δ           # Loop until the result no longer changes, using the (implicit) input-matrix:
 2Fø0δ.ø}   #  Add a border of 0s around the matrix:
 2F     }   #   Loop 2 times:
   ø        #    Zip/transpose; swapping rows/columns
     δ      #    Map over each inner row-list:
    0 .ø    #     Surround it with both a leading and trailing 0
 2Fø€ü3}    #  Convert the matrix into overlapping 3x3 blocks:
 2F    }    #   Loop 2 times again:
   ø        #    Zip/transpose; swapping rows/columns
    €       #     Map over each inner list:
     ü3     #      Split it into triplets
 εεÅsyøÅs«ß #  Get the minimum of each cross of each 3x3 block:
 εε         #   Nested map over the 3x3 blocks:
   Ås       #    Get the middle row-list of the current block
   y        #    Push the 3x3 block again
    ø       #    Zip/transpose; swapping rows/columns
     Ås     #    Push its middle column-list of this transposed block
       «    #    Merge the middle row and column together to a single list
        ß   #    Pop and push its minimum
]           # Close the nested map and changes-loop
 N          # Push the last 0-based index of the changes-loop
            # (which is output implicitly as result)
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip) `-x`, 29 bytes
```
YaWy&UiyFI:5={2>$+(aAD_)MSy}i
```
Takes input from the command-line as a string representing a Pip list of two-element lists, each of which represents the coordinates of a non-empty cell. [Attempt This Online!](https://ato.pxeger.com/run?1=PZJNSsRAFITBowwiigxY6Z-8tlEQRHDhSkQkBJmNkN0sFAziSdwIongJL-Jp7Kl6zqY-0u_xNUnl7WM9rb-GxfJ5Mb5_Pj0-LO3nbnU7791M88XlcTp56U53D_dXZ-f3B1fX8-ukHV_93fkeFsPQ1W6sLQMzMqEH-FNqCFwLXAtcC1XnxixMHAnahZahbWoiNZGaSE2sOjdmYVITpYnSRGmiNImCREGqOjFmYVKQJEgSJAky9zL3svb62jONWZgcGAfGgXFgGhQOCgeFg6IBwPdrCMLmSugTQ98Y3f9hErLQCyYUQdJGOF0EN_GVoG6gcqB2oHoastALJhRB_uB-Lw7eHMLWz48O1Qb1BhXXkIVeMKEIuiD6BV4pvFN4qfBW4VXBu9owjeP25_4D)
### Explanation
Port of [Jonathan Allen's Jelly answer](https://codegolf.stackexchange.com/a/260374/16766).
```
YaWy&UiyFI:5={2>$+(aAD_)MSy}i
Ya                            ; Yank the input into global variable y
  Wy                          ; Loop while y is not empty
    &Ui                       ; (and increment i on each loop):
       yFI:                   ;  Filter y by this function and assign back to y:
             {             }  ;   (Inside the function, the function argument is a)
                        MSy   ;   Map this function to y and sum the results:
                      _       ;    Each element of y (2-item list)
                   aAD        ;    Absolute difference (itemwise) with a
                $+(    )      ;    Add the two elements of the result
              2>              ;    1 if less than 2, 0 otherwise
                              ;   This gives the number of cells in cell a's 5-cell
                              ;   neighborhood (including the cell itself) that are
                              ;   nonempty
           5=                 ;   Return 1 if that fn's result is 5, 0 otherwise
                              ;  This filters and keeps only the nonempty cells
                              ;  that are surrounded by all nonempty cells
                            i ; After the loop, print the final value of i
```
]