I think you should use n = nr of pixels