Set quality of magento catalog product images directly in template files.
There is no need to dublicate and edit core files or adapters. New method called setQuality has been implemented since Magento CE 1.4 and can be used directly in template files. For example if you want to improve the quality of product images in category view, open app/design/frontend/yourpackage/yourtheme/template/catalog/product/list.phtml and add ->setQuality(100) in the end of img src as follows:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(122,180)->setQuality(100); ?>" alt="" />
Now we have good quality images in the product list.
Don't forget to empty the cache of images via System> Cache Management.