Slashdot Mirror


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.

46 of 325 comments (clear)

  1. Wonderful! by ModernGeek · · Score: 3, Interesting

    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.
    1. Re:Wonderful! by Swiper · · Score: 2

      Methods for retrieving information from pixelised images already exist, by no means black magic, they involve the use of wavelet analysis in combination with neural processing and recombination to refine an image. Examples of this kind of work are found in practical applications such as number plate recognition, where often a bad photograph is the starting point. This allows elements to be reconstructed even when information is partially missing. It's not an infinite super zoom as you see on CSI, that's just populist and totally unrealistic Ooh Aah effects, but it does work, given certain basic rules and parameters are respected.These methods are generally aiming at extracting information from the image, filling in the missing parts is from the image point of view just a little bonus, but the approach of vectorisation taken here is actually very closely related. Kudos to the guys for actually implementing it.

      --
      ~We demand rigidly defined areas of uncertainty~
    2. Re:Wonderful! by kerobaros · · Score: 2

      If an emulator were using this as a post-emulation filter, collision detection would still work just as well. The emulated system has no idea anything is being vectorised.

    3. Re:Wonderful! by ultranova · · Score: 4, Informative

      You know how often that discussion comes up on /. about how portrayal of computing is soooo unrealistic in the movies. Besides the point that most things are unrealistic in movies, this is very close to that "repeatedly zooming in pixelized images" effect often used, which people say it is impossible because the information isn't there.

      It is. This has nothing to do with that, but is about giving a nicer representation to information that is there. All this does is removes jagged corners that result from up-scaling.

      Just create a version of this specialized in different subjects, e.g. faces.

      Sorry, but that's just plain not going to work.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    4. Re:Wonderful! by kikito · · Score: 2

      "Just create a version of this specialized in different subjects, e.g. faces."

      Ok, you have done a pill that mitigates headhache.

      Just create a version of this specialized in different subjects, e.g. cancer.

    5. Re:Wonderful! by grumbel · · Score: 2

      Reconstructing image details accurately is still impossible and always will be.

      Why should that be always impossible? There is nothing all that hard in it, humans can do it pretty easily. The problem with these algorithms is that they are all pretty primitive and only really take local pixels into account, not the whole image, thus in the example in the article you have edges in the back and belly of dolphin, which are trivial to tell that they should be smooth, for a human at least. The highlights on th gradients are also wrong, as the algorithm apparently doesn't take them into proper account. While that might not be easy to fix, it isn't exactly impossible.

    6. Re:Wonderful! by dzfoo · · Score: 2

      like an emulator? many of them have advanced smoothing effects already, with options.

      Except that this algorithm vectorizes, instead of just upscaling the image with bigger pixels and smooth edges.

      there's just this ONE LITTLE PROBLEM, you can't recreate information the artist left in his head because there wasn't enough pixels

      Except that this algorithm is intended to accentuate the information that is there. Their thesis is that, on such low-resolution images, each individual pixel may convey important information that the artist added precisely because of the constraints of the platform.

      Thus, a single pixel could represent an eye, and a checkered pattern a squiggly line. These are trivially perceptible details which are non-obvious to mechanical detection. This new algorithm attempts to discern these peculiarities and uses heuristics to try to best match the intention of the artist.

      It is not perfect, and the authors even explain some cases where it fails, and even some suggestions for future improvements. However, it is darn good enough, and the fact that it generates a resolution-independent vector image makes it suitable for modern high-definition displays.

                  -dZ.

      --
      Carol vs. Ghost
      ...Can you save Christmas?
    7. Re:Wonderful! by ProfMobius · · Score: 3, Informative
      Because the information is simply not there ? You can add as much information you want to your pixels like curves and such, but you have no way to prove it is the original information.

      From TFA : "The other problem is that the Depixelizing Pixel Art approach always smooths images, even when an object shouldn't necessarily be smooth. For example, are Space Invaders really meant to be cute and round? Maybe, in the creator's eye, they had long, angular, razor-sharp mandibles and straight-out antennae! "

      They are adding information, but they have no way to know if it is what the original artist had in mind.

      --
      EULA : By reading the above message, you agree that I now own your soul.
    8. Re:Wonderful! by miro2 · · Score: 2

      I actually did RTFP and you are not quite as right as you blithely assert. The parent poster was correct.

      This has nothing to do with that, but is about giving a nicer representation to information that is there.

      Actually, the algorithm makes heuristic decisions which add information based on an understanding of the human visual system and assumptions about the problem space (it works well on hand-drawn cartoons, but not on down-sampled photos). For instance, they have heuristics for deciding which neighboring pixel fields should be attached to a pixel "island" by one of its four corners. In the original image, its completely ambiguous. In their enhanced version, its explicit. They are adding information based on background semantic knowledge.

      Sorry, but that's just plain not going to work.

      Actually, its not as impossible as you state. A low-res image of a face has two sets of information: the pixels themselves, and all of the constraints imposed by the fact that the image is of a face. There might be an infinite set of objects which could have generated a given pixel field, but there is a smaller infinity of faces that could generate said pixel field. So an image enhancer which understood it was looking at a face might be able to fill in some of the details. If it can deduce information about the lighting in the room, it might do even better. Such an image enhancer would be using semantic knowledge to add detail to the initial visual information....(drum beat)...just like your brain does! Computers might theoretically be able to do it better. So its just not as bone-head simple as you make it out to be.

    9. Re:Wonderful! by grumbel · · Score: 2

      How so? A video is just a series of fixed pictures, one after the other.

      Yes, but it are pictures of the same object in motion. Super simplified example: Imagine you have a one-pixel camera. A single frame of video of that will tell you nothing by itself, as its just a pixel, but if you take the camera, move it around in the right pattern and add the images together with the correct offset you can get a full 2D picture of whatever you are photographing. Same can be done with a 2D camera, you have to reconstruct how the images are shifted relative to each other and then add them together, that way you get a higher resolution then you have in a single frame, its called Super resolution. That is of course more useful for real photos then it is for video games.

      But for video games you would get plenty of benefit as well, as multiple frames tell you much more about the structure of the object, in a simple Space Invaders you might not be able to tell which pixel is part of the body and which is part of an arm or leg, in motion that however becomes pretty clear and thus you can avoid blurring pixels together that really represents different parts of an objects.

  2. Great. by hal2814 · · Score: 2

    Because we haven't strip-mined the past enough. I'm impressed by the results but weary of its implications.

    1. Re:Great. by gman003 · · Score: 2

      I was originally going to correct you for misspelling "wary" (characterized by caution; guarded; careful), but then I realized "weary" (expressive of fatigue) arguably made more sense in context (as in, you are tired of the things this implies will happen, ie. more remakes). So now I'm just asking which one you meant.

    2. Re:Great. by iamhassi · · Score: 4, Interesting

      You're kidding, right? This is allowing us to play all those games from our youth without them looking like blocks at 1080 HD. If anything this is helping the past, no longer will they need to release a "remake", they can re-release the original with this algorithm attached and they're done.

      Besides, do you think 1080 HD will be the resolution of choice 20-40 years from now? I imagine we'll be looking at wall-sized TVs at some point and 1080 pixels will look awfully blocky on a 10 foot wall. Sharp has already released a 7x680 x 4,320 pixel 85-inch screen, how long before 4320 is the new 1080?

      --
      my karma will be here long after I'm gone
    3. Re:Great. by gman003 · · Score: 3, Funny

      What the hell is Steve Jobs doing on /.?

    4. Re:Great. by Rei · · Score: 3, Informative

      The maximum theoretical human eye resolution (limited by aperture and focal length) is about 0.35mm per line pair at 1m. For most people with "normal" eyesight, the limit is closer to 0.7 mm at 1m. So for a TV that's 6 feet away and 2 feet tall, there's no point to a vertical resolution higher than ~1800 pixels, and 1080 is more than what most people can perceive. 4320 pixels at 6 feet makes no sense unless your TV is a minimum of 5 feet tall, and for most people, 15 feet ;) So yes, it really does take wall-sized TVs for that sort of resolution to even be useful. A 7" panel (~4" tall) with 1600 pixels vertical resolution? That's 0.06mm per pixel. The maximum theoretical distance in which that could be useful is under 7 inches, and more practically, closer to 3 inches away from the viewer. If you want that kind of resolution, you might as well make it into a planetarium ;)

      --
      You're not made of Tuesday!
    5. Re:Great. by RadioElectric · · Score: 2, Insightful

      I know "TFA" is rarely "R"ed around here but they use template-matching to preserve intentional hard angles. They use a guy with a sword as one of the EXAMPLE images!

  3. Re:PDF slashdotted by Anonymous Coward · · Score: 4, Informative

    http://johanneskopf.de.nyud.net/publications/pixelart/paper/pixel.pdf

    Don't tell me people have never heard of the coral cache

  4. Paper mirror by SheeEttin · · Score: 5, Informative

    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.)

    1. Re:Paper mirror by qubezz · · Score: 4, Informative

      If you read the article instead of looking at the pictures, the authors point out that this is one situation where the algorithm fails - the method is optimized for edge-finding in hand-drawn 8-bit pixel graphics. In more photo-realistic images like the doom face, especially later games where the graphics were rendered in 3d/hi-res and imported into the game (Donkey Kong Country would be a good example of this), vectorization doesn't work well due to the smoothed anti-aliased graphics.

  5. Re:PDF slashdotted by Anonymous Coward · · Score: 2, Insightful

    Since I can't read the PDF either, I'm forced to infer from the dolphin picture that it's raining cheese and the dalai lama is coming over for lunch.

    WTF original sketches? whose ass did you pull that from?

  6. Re:Alright... by Lehk228 · · Score: 3, Informative

    SUPER SAI is similar IIRC

    --
    Snowden and Manning are heroes.
  7. Re:So they . . . by shutdown+-p+now · · Score: 2

    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.

  8. Impressive, interesting flaw with the keyboard pic by syousef · · Score: 4, Insightful

    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
  9. Re:This is news? Anyone else run a NES emulator? by shutdown+-p+now · · Score: 4, Informative

    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.

  10. Yes, a regular expression joke by gman003 · · Score: 5, Funny

    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.

  11. Re:Kick ass! *I* do pixel art! by SomePgmr · · Score: 2

    IIRC, Inkscape had a nice raster to vector function that I had good luck with. I seem to remember it allowed for a bit of tweaking too, to achieve best results.

  12. Re:Yawn by nethneta · · Score: 4, Informative

    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.

  13. Re:This is news? Anyone else run a NES emulator? by smellotron · · Score: 2

    This is news? Anyone else run a NES on those dozen or so emulators that already has pixel-smoothing options?

    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.

  14. Re:Yawn by DigiShaman · · Score: 5, Informative

    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.
  15. Re:PDF slashdotted by Swimport · · Score: 4, Informative
  16. Re:Yawn by creat3d · · Score: 3, Insightful

    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.
  17. CORAL link to the PDF by Announcer · · Score: 4, Informative

    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...
  18. Re:Yawn by PsychicX · · Score: 2

    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.

  19. Re:Mostly good for Mario by sammyF70 · · Score: 3, Funny

    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
  20. The best I've come across by Vectify · · Score: 2

    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.

  21. Re:So they . . . by Sarten-X · · Score: 2

    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.
  22. The Real Test by bughunter · · Score: 2

    The real test for the Kopf-Lischinski algorithm will be how it can handle Nethack.

    --
    I can see the fnords!
  23. Re:This is news? Anyone else run a NES emulator? by osu-neko · · Score: 2

    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."
  24. Re:Yawn by polymeris · · Score: 2

    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).

  25. But the whole point is... by anti-pop-frustration · · Score: 2, Interesting

    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.

  26. On the next CSI: 8-bit by Keyboarder · · Score: 3, Insightful

    Zoom in on Mario a bit... Enhance...

  27. Would be great for LCD upscaling in GPUs! by bertok · · Score: 2

    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!

  28. Finally! by drolli · · Score: 2

    Commodore 64 Porn arrives in high-res

  29. Re:Impressive, interesting flaw with the keyboard by arth1 · · Score: 2

    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!

  30. Re:Sample image is not 8bit source by Briareos · · Score: 3, Informative

    Yeah, it's from Super Mario World, i.e. the SNES - and on the SNES "Sprites can be 8 × 8, 16 × 16, 32 × 32, or 64 × 64 pixels, each using one of eight 16-color palettes", which would make the dolphin a 4-bit sprite.

    --

    "I'm not anti-anything, I'm anti-everything, it fits better." - Sole

  31. Re:Yawn by dzfoo · · Score: 3, Funny

    Too late, you already did.

              -dZ.

    --
    Carol vs. Ghost
    ...Can you save Christmas?