We propose a bio-inspired framework for automatic image quality enhancement. Restoration algorithms usually have fixed parameters whose values are not easily settable and depend on image content. In this study, we show that it is possible to correlate no-reference visual quality values to specific parameter settings such that the quality of an image could be effectively enhanced through the restoration algorithm. In this paper, we chose JPEG blockiness distortion as a case study. As for the restoration algorithm, we used either a bilateral filter, or a total variation denoising detexturer. The experimental results on the LIVE database will be reported. These results will demonstrate that a better visual quality is achieved through the optimized parameters over the entire range of compression, with respect to the algorithm default parameters.