In[] := data2 = Table[Table[(Sum[data[[i,j,k]],{k,1,3}])/3,{j,512}],{i,512}]; In[] := gry=Image[data2]