A smooth and sharp image interpolation you probably haven't heard of
wordsandbuttons.online
wordsandbuttons.online
Neat aside, k = 1/x^∞ seems to be equivalent to nearest neighbor. (please excuse the abuse of notation)
Really at any size I tried, I found the "upscale" to look blurry / low quality.
Am I an outlier here?
Except in extremely rare situations, I flat-out refuse to work with low-quality source images in my design jobs. They can either give me a proper source image, pay me to rebuild it in a vector program if it's a logo or similar, or go down to the local sign shop and get someone to "design" something for them using a template. Most people end up having a higher quality copy around and just didn't know the difference between that and the screenshot they took of it, or the thumbnail they downloaded. At 300DPI with 4 colors, those flaws are glaringly obvious compared to screen resolution and sRGB color representation.
k(x) = 1/x
y_i * k(x - x_i) + y_i+1 * k(x_i+1 - x)
F = --------------------------------------- =
k(x - x_i) + k(x_i+1 - x)
y_i / (x - x_i) + y_i+1 / (x_i+1 - x)
= --------------------------------------- =
1 / (x - x_i) + 1 / (x_i+1 - x)
y_i * (x_i+1 - x) / A + y_i+1 * (x - x_i) / A
= ---------------------------------------------
(x_i+1 - x) / A + (x - x_i) / A
where A = (x - x_i) * (x_i+1 - x)
scaling to x_i+1 - x_i = 1, and using a = (x - x_i)
F = (1 - a) * y_i + a * y_i+1
The only time this wouldn't hold is when A = 0, but then F is not defined anyway. However, the graph of F shown is decidedly not that of the lerp function. // interpolation/extrapolation with no basis functions
var weight2d1 = 2;
const wf2d1 = function(x) {return 1./Math.pow(x, weight2d1);}SuperXBR is in the family of Edge-Directed interpolation algorithms, so diagonal or curved lines will properly maintain their shape when upscaled, and not produce "staircase" artifacts that you see with other classical interpolation. It does not improve the sharpness though, images will still look blurry after being upscaled, just like when you perform bilinear upscaling.
But if you are doing any kind of non-realtime image upscaling today, you'd want to use the modern AI algorithms, such as Waifu2x or ESRGAN.
PS: is it me or has it become more difficult to find cool stuff in your typical Linux distro?
I once made an image viewer that would apply the effect, but it's not publicly released.
There is an extremely roundabout way to see the effect in action on a Linux system using a package you can apt-get. It involves installing RetroArch, starting the "Image Viewer" core, loading an image, loading the shader preset named "super-xbr-2p.glslp", changing the number of shaders from 3 to 2 to exclude the "custom Jinc resharper" step and selecting Apply, then scaling the window to be exactly 2x the size of the original image. You probably don't want to do this.
But if you really want a standalone program, I could build a Windows .NET program that will apply the shader to images you paste in from the clipboard.
It's like nearest neighbor interpolation but with less artifacting when the zoom is not an integer. The middle of each source pixel becomes a solid color block, and then bilinear filtering is applied to the single-pixel-wide seams between each block.
It's equivalent to doing a nearest neighbor upscale to floor(scale), then finishing with bilinear.
For many use cases (editing old family photos etc), I'm increasingly not caring. I don't need per-pixel accuracy, I need a nice artifact that reminds me of a memory. If it looks 100 percent accurate to my eye, I'm not sure I care how much "fake" data it took to generate it. The important thing is it records the scene as I remember it.
This isn't hypothetical either; Photoshop already shipped their first iteration of the idea, for sure won't be the last:
> https://www.digitaltrends.com/computing/photoshop-generative...
> https://www.reddit.com/r/photoshop/comments/13s6tp9/using_th...
But, just as obviously, you're correct that AI is going to force itself into every possible application and it doesn't matter.
For simpler examples, compare:
- GPS signal power at the receiver is under the thermal noise floor, yet they can still be recovered if you know exactly where to look.
- Nonlinear image transformations like blurs can still be inverted if you know or can guess the transform and exact coefficients used. Which is why, to redact something, you really want to paint over it with uniform color, instead of blurring it.
Or just a lot of what photogrammetry is about.
If you only want an image to be 100% realistic you must stay at the original zoom level.
For scientifically correct scaling (think forensics) you will of course need to interpolate the source data instead of generating synthetic data which is done by AI upscaling.
Both use priors, the former a large and complex one, the latter a simplistic one, but both "invent data based on assumptions".
It’s not as fast yet but it’s extremely good. Good enough that you could print a low resolution image after upscaling.
Incidentally, the way I always thought it would work is the huge and slow AI would be used to discover a tiny algorithm that just so happens to be an amazing image rescaler. Instead we just ship the whole AI.
Anybody know of any work on the former strategy?
Aren't games using these for real time upscaling many dozen times a second already?