0x09 / resdet

Detect source resolution of upscaled images
GNU Lesser General Public License v2.1
234 stars 10 forks source link

Strange results from a videogame png #10

Closed robypez closed 3 years ago

robypez commented 3 years ago

A lots of videogames are using now dynamic resolution. The output is 4K, but the image is upscaled.

I try with a game screenshot of Gears 5, I know that the resolution is variable between 1080p and 2160p. I think to use resdet to draw a chart of the resolution change but this is the result

given: 3840x2160
best guess: 1278x27
all width        height
 1278 (55.71%)      27 (64.34%)
 1280 (55.17%)      37 (63.60%)
                    59 (61.96%)
                    12 (59.41%)
                    38 (58.70%)
                    69 (58.67%)
                    13 (58.09%)
                    28 (58.08%)
                    70 (57.91%)
                    20 (57.70%)
                    80 (57.68%)
                    51 (57.50%)
                    19 (57.33%)
                    91 (57.24%)
                    48 (57.09%)
                    60 (56.58%)
                    30 (56.50%)
                    29 (56.03%)
                    26 (55.90%)
                   124 (55.75%)
                    58 (55.66%)
                    81 (55.63%)
                   102 (55.57%)
                    62 (55.52%)
                    52 (55.30%)
                   116 (55.07%)

This is the original file

gears3

zvezdochiot commented 3 years ago

Hi @robypez .

Check also on the rotated image.

0x09 commented 3 years ago

@robypez looks like the default fast algorithm is getting confused by some of the spectral properties of the HUD. If I crop that out or try the orig or zerox methods, resdet reports that the image is not upsampled.

Based on this image though, I don't think the kind of upscaling being done by games like this is the kind that resdet will be able to recognize. Unless the entire frame is being scaled up uniformly with a conventional filter, it's not usually possible to distinguish in the frequency domain, at least via the mechanism resdet exploits. e.g. compare the difference between your screenshot and the same image after being resized in an image editor down to 1920x1080, then back up to 3840x2160.

Closing since this is an inherent limitation, but thanks for raising this, the example image was interesting to analyze see if anything could be determined from it or not.

robypez commented 3 years ago

@0x09 I'm wrong. And Resdet works!!!! The frame above is taken from a sequence that is real Ultra HD. And Resdet detect it right, not upscaled.

I try with batman, that I'm sure it is upscaled and this is the result

resdet batman.png
given: 3840x2160
best guess: 1600x1080
all width        height
 1600 (64.69%)    1080 (60.30%)

It works!!!

Sometimes if the image is totally dark I have to crop a portion but it works!

resdet alan.png
given: 384x216
best guess: 160x72
all width        height
  160 (55.13%)      72 (57.47%)