A novel method of measuring an electron beam's energy spectrum and divergence using Compton-scattered x rays created by colliding a laser with an electron beam has been developed and tested using the compact laser-Compton x-ray source at LLNL. The method only requires an x-ray imaging device and a filter material whose K-edge energy matches that of the Compton-scattered x rays. K-edge filtering of energy-angle correlated Compton x rays causes large variations in intensity over the viewing angle. These intensity variations contain information about the electron beam's properties. By using simulation tools and adjusting the beam parameters to match the shape of the acquired image, the electron beam can be characterized. As a demonstration of this technique, a 75-μm Sn foil was used to filter 30-keV Compton x rays created from Compton scattering of a 532-μm laser beam by a 30-MeV electron beam. The measured parameters were mean energy E=28.51±0.06 MeV, energy spread σE<0.3%, and beam divergence σθ=1.8±0.1 mrad.