Nim, 134 126 115 108108 78 bytes
import math,future
proc g(x:seq[seq[int]]):seq[int]=lc[x=>lc[(lc[x[j][i]|(j<-0..7),int].sum+4)shr 3|(i<-0..2),int]
Defines thean anonymous procedure g, which requires the input passed in as a double-nested sequence and outputs as a 3-element array. The procedure can only be used as an argument to another procedure; to test, use the following wrapper:
import math,future
import strutils
proc test(x: seq[seq[int]] -> seq[int]) =
echo x(#[ Insert your input here ]#)
test(x=>lc[(lc[x[j][i]|(j<-0..7),int].sum+4)shr 3|(i<-0..2),int])
A Nim sequence is an array with @ in front, like @[1, 2, 3]. An input to this procedure could therefore be:
@[@[0,0,0],@[255,255,255],@[0,0,0],@[255,255,255],@[255,255,255],@[0,0,0],@[255,255,255],@[0,0,0]]