A theory is developed on the assumption that early sensory processing aims at maximizing the information rate in the channels connecting the sensory system to more central parts of the brain, where it is assumed that these channels are noisy and have a limited dynamic range. Given a stimulus power spectrum, the theory enables the computation of filters accomplishing this maximizing of information. Resulting filters are band-pass or high-pass at high signal-to-noise ratios, and low-pass at low signal-to-noise ratios. In spatial vision this corresponds to lateral inhibition and pooling, respectively. The filters comply with Weber's law over a considerable range of signal-to-noise ratios.