Everyone knows scaling algorithms such as linear, cubic or lanczos or even specific ones like hqx or xBRZ.
But i thought i would talk about some of the lesser known scaling algorithms i think are pretty interesting.
Let's start with
Waifu2x first.
Waifu2x is an upscaling algorithm for anime-style art that was developped at a chinese university in Hong Kong, inspired by SRCNN.
(That's probably the only good thing China has done, read on)
It also supports noise cancellation but a picture with little to no noise gives me the best result.
The goal of the algorithm is to give sharper details to the art, compared to traditional algorithms.
Perhaps the best thing to explain it is to show it.
Left is cubic upscaling, Right is Waifu2xAs you can see, the Waifu2x processed image has much less blur and has sharper edges than the cubic one.
It is overall much prettier to look at than the cubic processed one.
Another test, here's the reference image. (it comes from School Days)
What i have done next is to upscale it using the cubic algorithm to 1920x1080.
Then, i tried to upscale it twice (since waifu2x only upscales two times) with waifu2x.
Here's the result (You need Firefox or Webkit to view the APNG picture)https://gameblabla.nl/img/waifu2x_result.pngThis time though, it is not as significant as the previous one, probably due to many details in the background.
But the edges around the boy are still much sharper than the cubic one, once again and the overall picture is less blurry.
I tried with other anime pictures and i got pretty good results, so far i am very happy.
Maybe i should try to upscale an old anime to 2k using waifu2x ?
Sadly, i do not have the processing power or space for that.
Moving on to...
Seam CarvingThis algorithm has a completely different purpose.
It was made in 2005 by a team in MERL with the goal of making an upscaler/downscaler that would keep most of details
in the picture when changing aspect ratios.
ImageMagick has an implementation of Seam Carving so i thought trying it out.
Our reference image is still the same :
I will reduce to 75% of its horizontal size. (out of 100%)
Here's what it would like when downscaled with Lanczos
You can see how it tries to keep important details like the main character without changing the proportions too much.
It results in a funny and non-consistent look though, especially for humans.
Let's try it with Obama instead :
Original:
Seam carved to 70% of its horizontal size :
Our president looks much thinner, he almost looks like a kid now !
Now let's try to downscale using this algorihm with our School Days picture :
Everything we knew about the picture before is now lost, it looks like something right from a nightmare...
Overall, it is best suited for paysages and aspect ratio changes.
Scalable Function GraphicsIf you are looking for the best upscaling algorithm for image recovery, this is the one.
Designed for photos, the results are simply stunning :
The picture is much less blurry than any other algorithms while managing to be fairly accurate to
the original picture.
Have a look :
Photofunction, the only software based around it, can upscale such an image using the SFG algorithm.
However this comes at a cost : on a AMD FX chip, upscaling a 64x32 picture can take up to 12 hours !
It is thus not very practical but it does not take advantage of graphics cards, which could help.
It is also crap for aurora beams. (where a simple algorithm such as cubic fairs better)
It makes me wish someone else would reimplement it using CUDA or OpenCL because the results are great.
Sadly, due to overheating, i can't demonstrate it to you.
But you can download Photofunction here (requires Java 8.0) :
https://gameblabla.nl/files/photofunction.zip