Automatic detection of the source resolution of upscaled images

corysama

Newcomer
Thought y'all might appreciate this ;)

https://github.com/0x09/resdet

FAQ
This utility takes an image or frame of video which may have been upscaled and attempts to exactly identify the original resolution.

How?
Traditional resampling methods tend to manifest as an odd extension of a signal's frequency domain combined with a low-pass filter (where the shape of the filter differs among the various resampling methods). Conveniently the Discrete Cosine Transform causes the zero-crossings of this extension to fall at exactly the offset the source was upscaled from. resdet works by trying to identify these inversions.
 
On second thought, I shoulda posted this to the Console Tech forum. If a mod could move it, I'd appreciate it.
That's what I get for posting while juggling three other tasks.
 
Code:
$ convert Lenna.png -resize 200% resized.png
$ resdet resized.png
given: 1024x1024
best guess: 512x512
all width        height
  512 (68.03%)     512 (67.83%)
 
Back
Top