Imaging Question: How to determine image quality?
Asked Answered
Z

5

9

I'm looking for ways to determine the quality of a photography (jpg). The first thing that came into my mind was to compare the file-size to the amount of pixel stored within. Are there any other ways, for example to check the amount of noise in a jpg? Does anyone have a good reading link on this topic or any experience? By the way, the project I'm working on is written in C# (.net 3.5) and I use the Aurigma Graphics Mill for image processing.

Thanks in advance!

Zigrang answered 12/1, 2009 at 12:19 Comment(0)
I
7

I'm not entirely clear what you mean by "quality", if you mean the quality setting in the JPG compression algorithm then you may be able to extract it from the EXIF tags of the image (relies on the capture device putting them in and no-one else overwriting them) for your library see here:

http://www.aurigma.com/Support/DocViewer/30/JPEGFileFormat.htm.aspx

If you mean any other sort of "quality" then you need to come up with a better definition of quality. For example, over-exposure may be a problem in which case hunting for saturated pixels would help determine that specific sort of quality. Or more generally you could look at statistics (mean, standard deviation) of the image histogram in the 3 colour channels. The image may be out of focus, in which case you could look for a cutoff in the spatial frequencies of the image Fourier transform. If you're worried about speckle noise then you could try applying a median filter to the image and comparing back to the original image (more speckle noise would give a larger change) - I'm guessing a bit here.

If by "quality" you mean aesthetic properties of composition etc then - good luck!

Insecticide answered 12/1, 2009 at 13:58 Comment(2)
basically, I only need to know the amount of noise and compression in a given image.Zigrang
Okay - so with any luck the EXIF tags will give you the compression and something based on a median filter and comparison back to the original image with give you a measure of noise: en.wikipedia.org/wiki/Median_filterInsecticide
A
2

The 'quality' of an image is not measurable, because it doesn't correspond to any particular value. If u take it as number of pixels in the image of specific size its not accurate. You might talk about a photograph taken in bad light conditions as being of 'bad quality', even though it has exactly the same number of pixels as another image taken in good light conditions. This term is often used to talk about the overall effect of an image, rather than its technical specifications.

Adar answered 7/3, 2011 at 18:0 Comment(0)
E
0

I wanted to do something similar, but wanted the "Soylent Green" option and used people to rank images by performing comparisons. See the question responses here.

Exquisite answered 12/1, 2009 at 12:42 Comment(0)
N
0

I think you're asking about how to determine the quality of the compression process itself. This can be done by converting the JPEG to a BMP and comparing that BMP to the original bitmap from with the JPEG was created. You can iterate through the bitmaps pixel-by-pixel and calculate a pixel-to-pixel "distance" by summing the differences between the R, G and B values of each pair of pixels (i.e. the pixel in the original and the pixel in the JPEG) and dividing by the total number of pixels. This will give you a measure of the average difference between the original and the JPEG.

Newman answered 12/1, 2009 at 13:39 Comment(0)
C
-2

Reading the number of pixels in the image can tell you the "megapixel" size(#pixels/1000000), which can be a crude form of programatic quality check, but that wont tell you if the photo is properly focused, assuming it is supposed to be focused (think fast-motion objects, like trains), nor weather or not there is something in the pic worth looking at, that will require a human, or pigeon if you prefer.

Clayton answered 12/1, 2009 at 12:26 Comment(8)
sure, you can't tell whether you're dealing with a nice image or not ;) I just need to roughly check whether the image might be of poor quality, technically. If you have a 3000*2000px image with a filesize of 500kb, the probability is quite high that it is not of too good quality.Zigrang
I just created 20,271 byte (19.7 KB) image that is 3000*2000 and I would say that the quality is Perfect, it exactly reflects what I intended it to. unkwndesign.com/HQPic.pngClayton
All the measurement of 3000*2000 = 1.5MB tells you is how much data is stored in the file, which may or may not be indicative of it's quality.Clayton
And more colors == bigger filesize what if the pic is of a starry sky? It could easily have a small file size, high resolution, and excelent QualityClayton
right, the number of colors really is a drawback on this form of comparison. but once again, it doesn't have to be too exact, just a rough guideline.Zigrang
I would stick with something like megapixel count, as resolution is usually a good enough (highly) rough determination.Clayton
Some of these suggestions obviously come from a complete misunderstanding of JPEG compression (which is basically an amalgam of everything from DCTs to Huffman coding). You cannot determine the quality of the image from its filesize... its just not possible.Creationism
@James Burgess - That is correct which is more or less what I stated.Clayton

© 2022 - 2024 — McMap. All rights reserved.