6

This question already has an answer here:

What I mean by "true" resolution is the resolution at which the maximum available amount of real detail is present. For an ideal picture this resolution is the same as the resolution encoded in the image file. However, in other cases the actual true resolution may be less than the resolution of the image file:

  1. If the image file was digitally scaled - for instance, if the camera has a "digital zoom" feature where it upsamples the individual pixels.

  2. If the image is not completely sharp and in focus.

In either of these cases, it is useful to me to have some mechanical method of identifying what the actual true resolution of the image is independent of what the image file says. How can I do this? Is there some software or algorithm which can take an image and analyze it and tell me the highest resolution it can be displayed at while showing detail at the resolution?

My initial naive expectation that it should be "obvious" and easy to determine by some simple mechanism such as compressed sizes is thwarted in cases where the upscaled image has noticable artifacting or noise not present in the original.

marked as duplicate by Philip Kendall, Hueco, xiota, Community Apr 29 at 6:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    I'm voting to close this question as off-topic because it seems to be a theoretical question without any true photographic application. – Philip Kendall Apr 28 at 17:37
  • 1
    The question of, "Is this cropped from a larger picture?" comes up all the time in photography. The fact that it can't be reliably determined is an important point and very much on-topic. – user10216038 Apr 28 at 17:58
  • 2
    @user10216038 whether or not something is cropped may be of use in making a photograph, but I’m failing to see the importance after the fact. If it’s a good clean photo, who cares if it was cropped to obtain the final composition? Isn’t that the advantage of high res sensors? – Hueco Apr 28 at 18:58
  • 1
    @Hueco from a purely hypothetical standpoint, an example of "who cares" might be a judge/panel for a photo contest who requires images to not be cropped (for some strange reason). Also, off the top of my head, perhaps some sort of detection of whether an image is modified (for journalistic submission purposes). I'm not weighing in on the topicality of this question, just devilishly advocating conceivable reasons to care. – scottbb Apr 28 at 19:22
  • 3
    This question assumes that OOF areas do not contribute to “true resolution”. Is a panned motion blur shot not “true”? How about a blurred photo shot through wet glass? What problem are you actually trying to solve? – Hueco Apr 28 at 19:37
9

You could compute the Fourier transform of the picture and analyze it in frequency space. If the image was upsampled, higher frequencies will be missing in the transformed image.

Note that the absence of the high frequencies could also mean that the original image did not contain enough detail, or it was not sharp in the first place.

Related: How to analyze images with Fast Fourier Transform method?

  • 3
    However there could also be fake high frequency components created by "sharpening" upscaler filters that try to trick naive users into thinking they're getting a better picture, while actually just making awful ringing all over the place. – R.. Apr 29 at 4:43
  • I have done this but I'm not sure exactly what to do with the results. I have two test copies of images, one of which is known to be a higher resolution, and in the magnitude the FFT is slightly brighter especially around the center. However, in phase space, the higher resolution image has ""waves" which appear to be emanating from the axes which the lower res image does not have. Complicating matters, the third image I am trying to actually compare against the higher res image has more noise in the magnitude (higher brights, interspersed with lower lows) and fringing around the axes... – Michael May 15 at 19:38
  • Whereas for the third image the phase space is much noisier (grainer) and also exhibits multiple even wave vertical patterns across the whole image, as well as a weird wave fringing pattern that follows both axes. – Michael May 15 at 19:40
  • Difficult to say anything without seeing it. May I suggest that you open a new question, with the sample image in both resolutions and the respective FFTs? That should be interesting! – bogl May 15 at 19:47
2

Assuming accurate meta data (EXIF) is present, it would be possible to determine possible camera model resolutions.

Without metadata it's a statistical guess from common available possibilities.

What you refer to as "True Resolution" is a difficult concept. To start with, digital cameras don't have pixels in the first place, they have sensors. The sensors in turn are processed to produce pixels, but many sensors produce one pixel and one sensor is part of many pixels.

There are image analysis/forensic tools for determining things like edited, cloned, recompressed, resized, and other alterations. Sometimes the JPG cosine compression tables or noise patterns can strongly indicate a particular camera.

In general, unless you can establish the camera model, I don't believe you can realistically get what you want.

1

What I mean by "true" resolution is the resolution at which the maximum available amount of real detail is present. For an ideal picture this resolution is the same as the resolution encoded in the image file.

To put that another way, you're trying to differentiate images where one pixel represents one pixel on the camera sensor (i.e., a 100% crop) from those that don't. So a shot taken with a full-frame lens on a full-frame SLR would be considered "true," as would one taken with a cropped-frame lens and cropped to just show what was in the image circle.

In either of these cases, it is useful to me to have some mechanical method of identifying what the actual true resolution of the image is independent of what the image file says. How can I do this?

Most cameras with digital zoom provide the DigitalZoomRatio EXIF tag which will tell you when scaling happened in-camera. You will not, of course, be able to tell if the image was scaled elsewhere or the metadata was tampered with unless you have some way to verify that the image and metadata were actually produced by the camera.

Assuming you trust the metadata, the ratio could be used to figure out that a 6000x4000 image that had a zoom ratio of 2.0 started life as 3000x2000. That doesn't mean the image can be scaled back down to that size and all will be well; any changes made during upscaling would have an effect on the downscaled version.

You can't do anything with the not-completely-sharp case for the simple reason that given just the image, there's no source of ground truth for what light fell on the sensor and no insight into the photographer's intent. Shooting with intentionally-small depth of field, putting a diffusing filter in front of the lens, producing motion blur or intentionally shooting out of focus would be captured at the camera's "true" resolution. Any algorithm trying to root out scaling would produce a wrong result.

The best you can do is read the metadata and decide whether or not you trust it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.