Histogram specification (equalization) is an important tool for tasks such as image enhancement and normalization. Although this problem has exact solution for continuous images, in the case of digital images, it is ill posed. Recently, an exact pixel ordering method based solely on local image intensity was proposed, yet still with some limitations, especially since it ignores the important image edge information. In this paper, we present a wavelet-based method that simultaneously achieves the exact histogram specification and good image enhancement performance. It does so through a carefully designed strict pixel ordering process, during which the wavelet coefficients are fine tuned for the image enhancement purpose. Compared to previous work, this approach takes into account not only local mean intensity values, but also local edge information. Other advantages include fast pixel ordering, good statistical models, and better image enhancement performance. Experimental results and comparison with state-of-the-art methods are presented.