In this paper, a new technique is developed to enhance the quality of JPEG compressed images. Based on the principle of learning by examples, the new method constructs the enhancement system adaptively. In order not to incur overheads, the processing system is designed to have only 7 parameters which can also be estimated off-line. Extensive simulations have been performed, results show significant improvements of both subjective and objective quality of JPEG compressed images. It is also observed that the new techniques performs competitively to state of the art techniques and is computationally more efficient.