Shannon number and degrees of freedom of an image