#Matlab with Image Processing Toolbox, 27 bytes
Matlab with Image Processing Toolbox, 27 bytes
@(a)a(~imerode(~a,~~(1:3)))
This is an anonymous function.
Example use:
>> @(a)a(~imerode(~a,~~(1:3)))
ans =
@(a)a(~imerode(~a,~~(1:3)))
>> ans([0 0 0 8 0 1 0 0])
ans =
0 8 0 1 0