Through ImageAPI, you can set the quality of images ImageCache produces. But since ImageAPI allows you to set only one global value, any image produced by ImageCache ends up in the same quality. If you want to have the highest-quality images in a photo gallery while having lower-quality images elsewhere, you are stuck.
This module allows you to override ImageAPI's quality setting and set image quality per ImageCache preset. Unfortunately, since ImageAPI does not let other modules hook into / alter the process, you need to apply the supplied (unobtrusive) patches to the following modules for this module to work:
imageapi.module
imageapi_gd.module
imageapi_imagemagick.module
imagecache.module
The patches basically only add optional arguments to existing functions so even if if Imagecache Quality module is disabled after patching, the above modules would function as normal (as far as I am aware). #725762: Quality Settings by ImageCache Profile
The patches, as well as an instruction on how to apply them / which version of ImageAPI / ImageCache to use, are found in README.txt.