How to measure the quality (or difference in quality) of different images? I would like to measure the quality of a color image, possibly as a difference to another image, but if possible, on its own too.

This question comes from the fact that we have a vision application, and improve lighting conditions, calbirations, and similar surrounding conditions. We want to measure the improvement of the quality of the image, such as:


Amount of detail
Contrast
Other things that describe the quality of an image or the amount of information in an image


Do you have ideas for this? Maybe histogram comparisons, or an advanced distance measure on the histogram? I'd love to hear some good ideas!

EDIT:

Of course the results of the vision application are a measure of the quality of the images. But:


it is not intended as a measurement for the quality, it is a measurement of something else
there are more parameters that influence the results of the application (for example the image itself), therefore it is only a rough measure of the quality of the image


I could use human evaluation, but I really want an objective measure, especially because the human eyes are not objective (our mind plays tricks, the monitor we watch it on influences the image, etc.).

FINAL EDIT:

After a discussion about what quality in an image is, I'll leave this question as is. My own ideas (and of my coworkers) are the following:


The range of the RGB channels (is it using all the colors possible)
The mean of the Sobel amplitude (the amount of detail or a rough measure of focus, also see this question about detail)
The amount of pixels that are clipped or 0 (no information in these pixels)
Also the mean of the RGB channels and the YCbCr channels (after conversion), to be able to see if the average color has changed (may lead to investigating light from other sources, or after changing our own lighting)


By combining these statistics we can get an impression of the quality from a more objective point of view, instead of just looking at the images. It also leads to pointers where the changes might come from.
It all depends on what you mean by "quality".  If it is visual quality as perceived by people, then the best thing to do is to ask multiple people to compare pairs of images to see which ones they like better.

Since you have mentioned a vision application, then it must have some performance metrics for whatever it does, which would be its measure of quality.

If by quality you mean how blurry or noisy the image is, then you might compute the Fourier transform to see whether the image contains high frequency components to see how blurry it is, or compute its entropy to see how noisy it is.