rebin
im2 :512x512
im3 :64*64
im3 = im2.reshape(64, int(512/64), 64, int(512/64)).mean(-1).mean(1)
#numpy