The efficient coding hypothesis suggests that the brain takes advantage of statistical regularities in natural scenes to compress sensory data without significant loss of information. This idea leads to predictions about the way in which sensory data is processed. Indeed, this approach has been used to successfully predict the salience of various binary textures given their abundance in natural scenes. The concept of texture in this case was defined in relation to the relative abundances of the 16 possible ways to fill a 2x2 patch with black or white pixels. Due to translational symmetry, this led to a 10-dimensional space for binary textures.

Here we generalize the binary definition of texture to apply to arbitrary grayscale images, allowing us to map grayscale textures to the same 10-dimensional space defined in the binary case. We show that the grayscale construction reduces to the binary case for binary images and study the distribution of natural images using the generalized definition. We check whether the natural statistics of grayscale images can predict the salience of binary and ternary textures as measured by psychophysical experiments. Finally, we discuss possible extensions of the model, including measuring the texture statistics at several different scales.