J, 39 3839 38 37 bytes
(' ',|.){~[:(>.*=+.*e1=<.,)"0/~|@i:&~#\.<:@#,1}.#\
Consider over
:
First imagine a table of coordinates like:
┌───┬───┬───┬───┬───┬───┬───┐
│4 4│4 3│4 2│4 1│4 2│4 3│4 4│
├───┼───┼───┼───┼───┼───┼───┤
│3 4│3 3│3 2│3 1│3 2│3 3│3 4│
├───┼───┼───┼───┼───┼───┼───┤
│2 4│2 3│2 2│2 1│2 2│2 3│2 4│
├───┼───┼───┼───┼───┼───┼───┤
│1 4│1 3│1 2│1 1│1 2│1 3│1 4│
├───┼───┼───┼───┼───┼───┼───┤
│2 4│2 3│2 2│2 1│2 2│2 3│2 4│
├───┼───┼───┼───┼───┼───┼───┤
│3 4│3 3│3 2│3 1│3 2│3 3│3 4│
├───┼───┼───┼───┼───┼───┼───┤
│4 4│4 3│4 2│4 1│4 2│4 3│4 4│
└───┴───┴───┴───┴───┴───┴───┘
For each element, ask "Are they equal or does either equal one" =+.*e.,
? The answer will be 1 if true, 0 otherwise. Multiply that answer by the max of the two numbers >.*
:
4 0 0 4 0 0 4
0 3 0 3 0 3 0
0 0 2 2 2 0 0
4 3 2 1 2 3 4
0 0 2 2 2 0 0
0 3 0 3 0 3 0
4 0 0 4 0 0 4
Now just index into the original input, reversed, with a space prepended (' ',|.){~
:
o o o
v v v
eee
overevo
eee
v v v
o o o