We present the binary supergrating (BSG), a digital approach to spectral engineering that permits the near-arbitrary control of optical amplitude and phase in a wavelength-dependent manner. The BSG is a guided-wave technology that consists of an aperiodic sequence of binary elements, leading to a simple, robust and practical form. This sequence, determined through the process of BSG synthesis, encodes an optical program that defines device functionality. Our approach to synthesis builds on existing knowledge in the design of "analog" gratings through a two-step process: first, exploit the best analog-domain methods, then transform the resulting structure into binary form. Accordingly, we explore the notion of diffractive structure transformation and introduce the principle of "key information". We assemble such key information for Bragg-regime structures, and employ it in the design of grating quantizers based on an atypical form of Delta-Sigma modulation. We illustrate this approach through the synthesis of a complex dense-wavelength division-multiplexed telecom filter featuring 50-GHz channel spacing, -40-dB stopbands, and 25-GHz-wide passbands that are flat to within 0.2 dB.