Upscaling Retro 8-Bit Pixel Art To Vector Graphics
An anonymous reader writes "Two researchers — Johannes Kopf from Microsoft, and Dani Lischinski from The Hebrew University — have successfully created an algorithm that depixelizes and upscales low-resolution 8-bit 'pixel art' into lush vector graphics. The algorithm identifies pixel-level details (original paper — PDF) to accurately shade the new image — but more importantly, the algorithm can create smooth, curved contour lines from only-connected-on-the-diagonal single pixels. At long last, we might be able to play Super Mario Bros. on a big screen without stretching our beloved plumber's pixels to breaking point. You really must look at the sample images." Scroll down in the paper to see how their technique stacks up against some others, including Adobe's Live Trace.
I've always thought that this would be possible. Now we just need to create a translator that will let us play our retro games with vector graphics.
Sig: I stole this sig.
PDF got slashdotted immediately, but the dolphin image shown in the first article is quite stunning.
Its a pretty common practice to take drawings and scale them down, and repaint for sprites
Because we haven't strip-mined the past enough. I'm impressed by the results but weary of its implications.
Being able to convert low resolution pixel art into nice vectors like that is kick ass. I wish they had released a utility to try it out on other materials. (like my own..)
I do some of my best work in a work envelope around 100x100 pixels.
EvilHom3r over on Reddit seems to have mirrored the paper (as images) here.
My verdict: Yeah, it looks all nice and smooth, but with all upscaling, it's basically interpolating data. The original just didn't have that much detail, so you can only get so much out of it. Sometimes it works, sometimes it doesn't.
(Oh, and it makes all text look pretty bad. Kinda Comic Sans-y, if I can say that without invoking instant hate.)
http://webcache.googleusercontent.com/search?q=cache:15iKIgSAkDwJ:johanneskopf.de/publications/pixelart/paper/pixel.pdf+http://johanneskopf.de/publications/pixelart/paper/pixel.pdf&cd=1&hl=en&ct=clnk&gl=us&client=iceweasel-a&source=www.google.com
Minecraft's about to get a whole lot better.
Now we need realtime implementation in ZSNES....
Are you implying that VectorMagic does the same thing just as well or better (making this research irrelevant), or that VectorMagic is the first bitmap vectorisation algorithm?
(hint: both are wrong)
They mention that form of approach in the introduction and reference Hqx specifically in Section 2: Previous work.
As mentioned two posts up there's an image of the paper (so text search blows) here: http://imgur.com/a/gRXPJ
...such as 2001's HQ3X (http://www.hiend3d.com/hq3x.html) which both awesome and as common as dirt ten years later.
Article author Sebastian Anthony looks like a tech nitwit with the "at long last, we might be able to play Super Mario Bros. on a big screen without stretching our beloved plumber's pixels to breaking point" comment.
No, not really. From the paper:
Various commercial tools, such as Adobe Live Trace [Adobe, Inc.2010] and Vector Magic [Vector Magic, Inc. 2010], perform automatic vectorization of raster images. The exact nature of the underlying algorithms is not disclosed, however, they generally do not perform well on pixel art images, as is evidenced by the comparisons in this paper and in our supplementary material.
EvilHom3r over on Reddit seems to have mirrored the paper (as images) here.
My verdict: Yeah, it looks all nice and smooth, but with all upscaling, it's basically interpolating data. The original just didn't have that much detail, so you can only get so much out of it. Sometimes it works, sometimes it doesn't.
(Oh, and it makes all text look pretty bad. Kinda Comic Sans-y, if I can say that without invoking instant hate.)
I know what you mean but it's pretty impressive nonetheless. The flaw I found interesting was in the keyboard image. I'm sure the intention here is square keys, but their algorithm made all the keys round. Some things in a pixelated image should not be smoothed but without human context that's a very hard call to make.
These posts express my own personal views, not those of my employer
RTFP - they list the various existing upscaling algorithms, and why they're not perfect:
Several later algorithms are based on the same idea, but use more sophisticated logic to determine the colors of the 2x2 block. The best known ones are Eagle [Unknown 1997], 2xSaI [Ohannessian 1999], and Scale2x [Mazzoleni 2001], which use larger causal neighborhoods and blend colors. Several slightly different implementations exist under different names, such as SuperEagle and Super2xSaI. An inherent limitation of all these algorithms is that they only allow upscaling by a factor of two. Larger magnication canbe achieved by applying the algorithm multiple times, each time doubling the resolution. This strategy, however, signicantly reduces quality at larger upscaling factors, because the methods assume non-antialiased input, while producing antialiased output.
The latest and most sophisticated evolution of this type of algorithms is the hqx family [Stepin 2003]. This algorithm examines 3x3 pixel blocks at a time and compares the center pixel to its 8 neighbors. Each neighbor is classied as being either similar or dissimilar in color, which leads to 256 possible combinations. The algorithm uses a lookup table to apply a custom interpolation scheme for each combination. This enables it to produce various shapes, such as sharp corners, etc. The quality of the results is high. However, due to its strictly local nature, the algorithm cannot resolve certain ambiguous patterns and is still prone to produce staircasing artifacts. Lookup tables exist only for 2, 3, and 4 magnication factors.
whereas what they did here is:
Our goal in this work is to convert pixel art images to a resolution-independent vector representation, where regions with smoothly
varying shading are crisply separated by piecewise-smooth contour curves.
Seriously, just look at the whale image linked from TFS.
I'm going to steal it. Next time I see something I'm both apprehensive, and tired of, I shall be /we?ary/ of it.
PDF mirror is here
If you read the paper (which is presently slashdotted) you'll see that they compare their results to existing pixel-smoothers, and theirs definitely look better in pretty much every case.
So it's not "Hey, we invented this new thing no one ever thought of!" so much as it's "Hey, we invented this better way of doing something that already exists."
I, for one, look forward to having better graphics in emulators.
ENHANCE! http://www.youtube.com/watch?v=Vxq9yj2pVWk
The authors of the article are aware of other scaling algorhythms, and discuss and compare their work to them. RTFA.
Last time I checked, these filters you speak of in Zsnes and other emulators simply extrapolate the pixels without paying any special attention to shapes and colors. TFA picture looks quite a bit more advanced.
let me patch you up until you can get back too the first grade.
Please return your grammar Nazi card on the way out.
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
Yes, this is news. Most scientific and technological advancement is iterative improvement. This paper describes an improvement in the state-of-the-art for vectorizing pixel art (which is not the same as pixel-smoothing, though a vectorized image is usually re-rasterized for display).
Seriously, read the paper. The algorithm described will require some basic understanding of splines and graph algorithms, but it's surprisingly accessible for a graphics/vision paper. Also, shiny pictures.
Those are all post-processing up-scaling effects. But they do have limitations in that even the pixels themselves can still be made out. Obfuscating them only goes so far. But with this new technique, they're pure vectors. They will scale infinitely with splines to match your screen resolution, much like fonts.
Life is not for the lazy.
I'm pretty sure that's a dolphin, actually... OK, so maybe their algorithm isn't perfect yet ^_^
Yes, but what lines are you smoothing? That's what this algorithm's about - generating the lines.
And yet you didn't.
I play in Znes with the Hq3x filter. It might be good, but it's nowhere near the quality of what these people have accomplished. Znes having this technique implemented would be amazing,
Grammar nazis are to this community what excrements are to gold.
It looked like it was on the verge of a Slashdotting, so I CORALized it.
http://johanneskopf.de.nyud.net/publications/pixelart/paper/pixel.pdf
Very interesting, and quite effective.
Willie...
I've posted the CORAL link to the PDF under the original article.
Willie...
You can't understand the difference between SCALING and VECTORIZING? Really? Scaling algorithms increase the number of pixels, but you're fundamentally still dealing with a raster image. A vectorized drawing is a whole different beast.
That said, I would like to compare the final results against a best of breed scalar like hq4x for the same final output resolution.
This looks a lot like what you might end up with if you use the image tracing function in Flash to convert bitmaps into...vectors.
Spoke too soon, the paper has an hq4x comparison. The results are really, really good -- it actually manages to do a better job than hq4x on Super Mario World.
Which is exactly what TFPDF says. Your rating : 10/10 on reading skills, 1/10 on creativity ...
"DRM is like the Ford Pinto: it's a smooth ride, right up the point at which it explodes and ruins your day."-C.Doctorow
I redraw bitmaps as vector art as a little side business, and I have to say this is the best "livetrace" automated program I've come across. Shameless plug: Vectify.com. Still no substitute for hand drawn (rounded corners that should be sharp; variable, wobbly line widths; but very good for an automated process). I've scanned through the PDF paper, and it looks like it's too CPU intensive to be used in retro games in realtime: from page 6, "There are many avenues for future work. Obviously, it would be nice to optimize the performance of the algorithm so that it can be applied in real-time in an emulator." As someone who used to play old games via dosbox and SNES9x, having something like this as a selectable filter option one day would be welcome. Now that I think about it, this kind of thing would be useful for app developers who want to scale up low-res artwork to work on higher res displays (like going from the original iPhone to the iPad). At least, it could be used as a starting point to further manual refinement.
No it would make it worse, as pixels look better than cartoonish vectors.
*clickityclackity* "enhance." *clickityclackity* "enhance!"
Corel PhotoTRACE was out in 1993, and produced results comparable to the Live Trace examples in the PDF. Such results are far inferior to this algorithm in most of the provided examples.
You do not have a moral or legal right to do absolutely anything you want.
The real test for the Kopf-Lischinski algorithm will be how it can handle Nethack.
I can see the fnords!
The paper actually mentions them, compares how they work and describes what was improved.
This is news? Anyone else run a NES on those dozen or so emulators that already has pixel-smoothing options?
One suspects that if /. posted an article about a new engineering method that will allow us to finally build a cheap, working space elevator, you'd post, "This is news? Haven't we had ways of making cables for centuries?"
"Convictions are more dangerous enemies of truth than lies."
I bet most of Doom is a disaster too.
Wasn't the picture in the original article where they show how it fails on those kinds of graphics, in fact, from Doom?
"Convictions are more dangerous enemies of truth than lies."
The hq2x and hq4x filter are all specially made to handle pixel art shapes. Even the generic filters are selected for their ability to upscale pixel art well.
Yeah, they are dolphins wearing swimming masks, from Super Mario World: http://www.youtube.com/watch?v=W94OrZU4-aw&t=428
Have a look at the paper, if you haven't yet. Their algorithm is impressive, but even in the samples they chose, some things get better results (IMO) with hq4x (Fig. 10, Mario Bros. scene, perhaps?) or Photo Zoom 4 (Fig.9, That warrior with the sword).
This looks good because it is specialized for 8-bit manually created graphics. 8-bit graphics with a broad palette has little shading, so it's usually unambiguous which pixel attaches to which adjacent pixel. Vectorizing 24-bit color images, or 8-bit images from photographs, requires more guesses about how wide things are and where the edges are supposed to be.
Nice if you really want to play 80's games in higher resolution.
I just lost the game.
That we like the way pixel art looks in the first place!
This project is technically interesting but as art it completely misses the point. Not every piece of human creation needs to be updated, upscaled, "improved" and redone.
I know the originals make more sense to me.
It's not about pretending that Avant Vector on the Atari ST and a pile of things before and after didn't exist, it's about a better technique to get vectors out of bitmaps than the existing ones.
I am stumped as to why everybody seems to think it can be applied in emulators with the same ease as pixel resamplers where.
If this would be used properly, it should evaluate each bitmap *on its own* before it is part of the screen, and then instead draw the resulting vector image to the screen, ofcourse matching the pixel coordinates. You cannot simply apply this to a any screenshot or video as it would give undesired results most of the time.
I would very much like to see a HD youtube video that shows how this algorithm holds up when processing a Mario World gameplay video, one that shows a .GIF video, and one that shows a normal (but downsampled) outdoor video.
Hivemind harvest in progress..
Zoom in on Mario a bit... Enhance...
Looks like somebody just watched Zeitgeist~
NVIDIA and AMD should implement this and related algorithms for their LCD upscaling!
The algorithm looks like it could be parallelized onto the GPU easily enough, and doing it transparently at the video card driver level would enable PC gamers to play classic games on large LCDs without the thumbnail sized pixels.
Just imagine what this scaling algorithm could do for classic low-res games like Diablo.
This is why closed-source sucks... I'd have done it myself by now if I had access to the AMD GPU Windows driver source code!
Can someone link to the MAME build that supports this? ....
What do you mean they're not coding this directly into MAME source?!?!?!
Commodore 64 Porn arrives in high-res
The image of the dolphin comes from Super Mario World, which was for the Super Nintendo. That was a 16bit game on a 16bit system. Anyone who played the 8bit Super Mario Bros games can tell you there were no dolphins in those games.
Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
I'm not so sure, especially not on the (remastered) VGA Sierra editions. Go look at page 7 of the PDF and you'll notice the "Axe Battler" which is reminiscent of the VGA Sierras. Worked just fine.
Now the original EGA sprites (or equivalent, back in the day, the PC wasn't the "Ruler" in the home computing world) probably would be a lot trickier.
Ahhh...the great dumpster continuum. Many a free computer will be found there. -- sowth (748135)
Also, the pins of the chip was a failure, becoming sawtooths instead of parallel pins.
The problem with this algorithm, like many others, is that it's subject to an extension of the Pareto principle. In 80% of cases, it may be an improvement, but that doesn't help if it makes the result worse in 20%. Cause it's the failures we notice, and judge quality by.
Algorithms like this also don't work well for animated sprites. Our imagination can fill in the gap between Mario holding the hammer above his head and the hammer hitting a barrel, precisely because of the technical limitations. But the same abrupt transition with high res splines would be jarring. (And a morph would be even worse)
Speaking of failures, I must say the greatest result was Adobe's version of the fish. They were the only one that managed to make the fish more scary!
It looks like their vectorized version has 1 less colour than the original.
Sure the vector version is nicer, but if every pixel is important, why would the algorithm decide to drop the light blue?
Too late, you already did.
-dZ.
Carol vs. Ghost
Why not? He got that pissed over a missing capitalization.
Unfortunately it seems the output is a collection of splines which are then recombined with the original image data to produce a shaded image at arbitary resoloution. Which is a nice result don't get me wrong but it looks like it would still be some further effort to turn the result into a standard vector format.
Also they don't seem to have released the code so to actually use this one would have to try and reimplement the technique from the info in the paper.
note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
Some algorithms find better balance than others. Hq4x, used as one of the examples in the paper, does that for me - maybe not as "smooth", but generally nice enough. Plus it rarely gives something weird, IMHO maintains decent consistency in the look of the games.
Or maybe I'm just used to it... (with it and similar around for a decade+, in various emulators)
One that hath name thou can not otter
1. Apply it to each individual sprite while loading the ROM.
2. Create an alternate sprite table with vector graphics.
3. Create two rendering loops, one internal for the original sprites and one going to the screen with the new sprites.
4. ???
5. Profit
EULA : By reading the above message, you agree that I now own your soul.
The real drawback with hqx is that they are fixed-multiplier upscalers. I can take an old game with a 320x200 resolution and scale it up to 960x600, and it looks great, but if I want to play it full screen then I need to do more traditional interpolation to get it up to my screen resolution. It still looks nice, but not as good. Being able to scale up to an arbitrary resolution in one step is much better.
That said, when I was at the University of Utah around 2006, I saw some very similar results to the pretty pictures in the paper (I've not read the words yet), using a similar approach. I don't know where their results were published, so I can't compare the results in detail, but the idea of creating topology maps from image data and then using this to generate rasters at arbitrary resolutions is not new - they were mainly looking at it as a compression scheme, since the topology maps can be tiny; smaller than a low-resolution bitmap, but able to be scaled up to high resolutions without artefacts.
I am TheRaven on Soylent News
so it looks like the fighters hit each other with soft nerf bats instead of swords
A baseball bat has a smooth contour, but as Ness shows in Super Smash Bros. series, it's still a formidable weapon.
Anyone know the difference between a pixel scaler and a vectorizer?
Give me Classic Slashdot or give me death!
You can't understand the difference between SCALING and VECTORIZING? Really? Scaling algorithms increase the number of pixels, but you're fundamentally still dealing with a raster image. A vectorized drawing is a whole different beast.
Your words are all true, but the reality of the situation is that the images are going to be displayed on a pixel-based device. The input is just pixels, and the eventual output is also just pixels. This approach, that internally uses vector graphics, appears to work incredibly well - but they're final results aren't better simply because they use vectors.
You're special forces then? That's great! I just love your olympics!
I mean, if you can program a GPU to do it, great. Otherwise, you're probably better sticking with hq2/4x and using a texture map onto a flat surface to get arbitrary scaling.
I'd have to see a comparison between TFA's picture and zsnes to be certain, but I agree with the AC. At least going by memory, it doesn't look any different from what I recall zsnes looking like.
If someone has a comparison image handy, it'd certainly be welcome. Otherwise I'll just check it out myself when I get home.
"I'm not sure I like the fugnutish tone you used in your post!" -RogL (608926)-
A pixel scaler is an algorithm that makes a different resolution output image, for example upscaling 320x240 to 640x480. Most existing pixel scalers look at neighboring pixels (2x2 or 3x3 area) to decide how to replace one input pixel with NxN output pixels.
A vectorizer is an algorithm that creates a vector representation of an image input as pixels. You can then use that vector representation to render at a higher resolution (any zoom factor, not just integer values), but you could do other things such as rendering at the same resolution but with anti-aliasing or even scaling down.
Pixel resamplers have the same problem: if you have a sprite moving over a background which has some colors in common with the sprite, the scale algorithm will detect the wrong edges and you'll see artifacts. However, even though it is not perfect the result is still acceptable to most people.
Yes, but these low-detail originals were enough to fool the brain, in our minds we "knew" what these would look like if they were well drawn. I'm sure an algorithm could be developed to guess at these details the way our brains do.
Twinstiq, game news
The svg contains a PNG. This is not helpful.
<image x="1310" y="10177" width="19590" height="7968" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACiQAAAQgCAIAAADjEzFOAAAACXBIWXMAADPEAAAz
-molo
Using your sig line to advertise for friends is lame.
The Super NES drew things in layers, so emulators are able to up-res each layer separately. The TV would try and up-res the entire screen all in one shot, so some of the details of the characters and backgrounds might get mixed up together. If part of the outline of the character is black and part of the background is black, then the TV upscaler might think the two are joined together. If a previous-frame(s) algorithm were implemented it might help to mitigate some of these issues, but that wouldn't stop problems with static screens.
Twinstiq, game news
Can I get the *reverse* of that, i.e. downscaling big-ass vector graphics to 8-bit?
I agree on the importance of the development of this new method. However I cannot help but think that there is no perceptible difference between the hq4x result and their algorithm in Figure 9 (SNES mario picture). Myabe the difference (of these two methods) will be more evident with big screens.
Ubuntu is an African word meaning 'I can't configure Debian'
Actually, the keyboard ends up looking a bit like a typewriter. It's a little weird to modern sensibilities, but there were whole decades when most typewriter keys were round, or at least all the old-style non-electric ones I've seen had round keys.
The Quirkz Handbook of Self-Improvement for People Who Are Already Pretty Okay
The actual SNES/NES/gameboy consoles had data structures in memory for storing individual sprites. You'd want to have your algorithm somehow correlate individual data structures with onscreen elements so that it would know what each discrete sprite was.
[blockquote]Speaking of failures, I must say the greatest result was Adobe's version of the fish. They were the only one that managed to make the fish more scary![/blockquote]
In Super Mario World, the dolphins appear in the level 'Vanilla Secret 3' and help Mario complete the level and avoid the otherwise unkillable puffer fish by serving as flying platforms. They are not intended to look scary. :)
Algorithms like this also don't work well for animated sprites. Our imagination can fill in the gap between Mario holding the hammer above his head and the hammer hitting a barrel, precisely because of the technical limitations. But the same abrupt transition with high res splines would be jarring. (And a morph would be even worse)
Anime fans are just fine with characters that are detailed yet jerkily animated.
'nuff said.
Yes, it is very impressive. If I remember correctly hq2x and hq4x are not even real algorithms, they are hand-written tables designed to work well. Even if the new algorithm was not a visual improvement (it is), it would still be impressive.
So what? At the time of scaling, which for video games has to be the time of playing in realtime, the output resolution is known. Sure, we can all come up with fairy-tale scenarios of 8-bit video games that will be recorded and re-displayed on big screens and watches, but in real life that just doesn't happen enough to be statistically significant.
You're special forces then? That's great! I just love your olympics!
I meant the "smoothing" of lines, not necessarily vectorization.
Table-ized A.I.