Рубрики

picture

Steps to magnify a picture for tracing

Amaya Hamilton


Tutorial | Tracing Pixel Art

Before we had access to great vector graphics editing software.

Even before we had 640×480 computer displays.

It was common to play video games with carefully crafted pixels in low resolutions displays.

We name “Pixel Art” the kind of art born in this age.

Inkscape is powered by libdepixelize with the ability to automatically vectorize these “special” Pixel Art images. You can try other types of input images too, but be warned: The result won’t be equally good and it is a better idea to use the other tab in Inkscape’s Trace Bitmap dialog.

Let’s start with a sample image to show you the capabilities of this tracer engine. Below there is an example of a raster image (taken from a Liberated Pixel Cup entry) on the left and its vectorized output on the right.

libdepixelize uses Kopf-Lischinski algorithm to vectorize images. This algorithm uses ideas of several computer science techniques and math concepts to produce a good result for pixel art images. One thing to notice is that the alpha channel is completely ignored by the algorithm. libdepixelize has currently no extensions to give a first-class citizen treatment for this class of images, but all pixel art images with alpha channel support are producing results similar to the main class of images recognized by Kopf-Lischinski.

The image above has alpha channel and the result is just fine. Still, if you find a pixel art image with a bad result and you believe that the reason is the alpha channel, then contact libdepixelize maintainer (e.g. fill a bug on the project page) and he will be happy to extend the algorithm. He can’t extend the algorithm if he don’t know what images are giving bad results.

The image below is a screenshot of Pixel art dialog in the English localisation. You can open this dialog using the Path ⇒ Trace Bitmap ⇒ Pixel art menu or right-clicking on an image object and then Trace Bitmap .

This dialog has two sections: Heuristics and output. Heuristics is targeted at advanced uses, but there already good defaults and you shouldn’t worry about that, so let’s leave it for later and starting with the explanation for output.

Kopf-Lischinski algorithm works (from a high-level point of view) like a compiler, converting the data among several types of representation. At each step the algorithm has the opportunity to explore the operations that this representation offers. Some of these intermediate representations have a correct visual representation (like the reshaped cell graph Voronoi output) and some don’t (like the similarity graph). During development of libdepixelize users kept asking for adding the possibility of export these intermediate stages to the libdepixelize and the original libdepixelize author granted their wishes.

The default output should give the smoothest result and is probably what you want. You saw already the default output on the first samples of this tutorial. If you want to try it yourself, just open the Trace Bitmap dialog, select Pixel art tab and click in OK after choosing some image on Inkscape.

You can see the Voronoi output below and this is a “reshaped pixel image”, where the cells (previously pixels) got reshaped to connect pixels that are part of the same feature. No curves will be created and the image continues to be composed of straight lines. The difference can be observed when you magnify the image. Previously pixels couldn’t share a edge with a diagonal neighbour, even if it was meant to be part of the same feature. But now (thanks to a color similarity graph and the heuristics that you can tune to achieve a better result), it’s possible to make two diagonal cells share an edge (previously only single vertices were shared by two diagonal cells).

The standard B-splines output will give you smooth results, because the previous Voronoi output will be converted to quadratic Bézier curves. However, the conversion won’t be 1:1 because there are more heuristics working to decide which curves will be merged into one when the algorithm reaches a T-junction among the visible colors. A hint about the heuristics of this stage: You can’t tune them.

The final stage of libdepixelize (currently not exportable by the Inkscape GUI because of its experimental and incomplete state) is “optimize curves” to remove the staircasing effect of the B-Spline curves. This stage also performs a border detection technique to prevent some features from being smoothed and a triangulation technique to fix the position of the nodes after optimization. You should be able to individually disable each of these features when this output leaves the “experimental stage” in libdepixelize (hopefully soon).

The heuristics section in the gui allows you to tune the heuristics used by libdepixelize to decide what to do when it encounters a 2×2 pixel block where the two diagonals have similar colors. “What connection should I keep?” is what libdepixelize asks. It tries to apply all heuristics to the conflicting diagonals and keeps the connection of the winner. If a tie happens, both connections are erased.

If you want to analyze the effect of each heuristic and play with the numbers, the best output is the Voronoi output. You can see more easily the effects of the heuristics in the Voronoi output and when you are satisfied with the settings you got, you can just change the output type to the one you want.

The image below has an image and the B-Splines output with only one of the heuristics turned on for each try. Pay attention to the purple circles that highlight the differences that each heuristic performs.

For the first try (top image), we only enable the curves heuristic. This heuristic tries to keep long curves connected together. You can notice that its result is similar to the last image, where the sparse pixels heuristic is applied. One difference is that its “strength” is more fair and it only gives a high value to its vote when it’s really important to keep these connections. The “fair” definition/concept here is based on “human intuition” given the pixel database analysed. Another difference is that this heuristic can’t decide what to do when the connections group large blocks instead of long curves (think about a chess board).

For the second try (the middle image), we only enable the islands heuristic. The only thing this heuristic does is trying to keep the connection that otherwise would result in several isolated pixels (islands) with a constant weight vote. This kind of situation is not as common as the kind of situation handled by the other heuristics, but this heuristic is cool and help to give still better results.

For the third try (the bottom image), we only enable the sparse pixels heuristic. This heuristic tries to keep the curves with the foreground color connected. To find out what is the foreground color the heuristic analyzes a window with the pixels around the conflicting curves. For this heuristic, you not only tune its “strength”, but also the window of pixels it analyzes. But keep in mind that when you increase the window of pixels analyzed the maximum “strength” for its vote will increase too and you might want to adjust the multiplier for its vote. The original libdepixelize author think this heuristic is too greedy and likes to use the “0.25” value for its multiplier.

Even if the results of the curves heuristic and the sparse pixels heuristic give similar results, you may want to leave both enabled, because the curves heuristic may give an extra safety that the important curves of contour pixels won’t be hampered and there are cases that can be only answered by the sparse pixels heuristic.

Hint: You can disable all heuristics by setting its multiplier/weight values to zero. You can make any heuristic act against its principles using negative values for its multiplier/weight values. Why would you ever want to replace behaviour that was created to give better quality by the opposite behaviour? Because you can. because you might want a “artistic” result. whatever. you just can.

And that’s it! For this initial release of libdepixelize these are all the options you got. But if the research of the original libdepixelize author and its creative mentor succeeds, you may receive extra options that broaden even yet the range of images for which libdepixelize gives a good result. Wish them luck.

All images used here were taken from Liberated Pixel Cup to avoid copyright problems. The links are:

  • http://opengameart.org/content/memento
  • http://opengameart.org/content/rpg-enemies-bathroom-tiles

Authors: Vinícius dos Santos Oliveira; Nicolas Dufour; Kris De Gussem; Gellért Gyuris; Maren Hachmann

Header / footer design: Esteban Capella — 2019





How to Trace a Picture?

Amaya Hamilton

Amaya Hamilton

Updated On :Aug 22, 2023

It can be a really useful skill to know how to trace a picture because it allows you to add much needed precision to your drawings and artistic ideas in general. Not to mention that the very process of tracing can noticeably improve your drawing skills since it also involves following design patterns and lines carefully. Besides that, more people also seem to be interested in AI Face Generator. You can know more from the link. Additionally, once you know how to trace a photo and do so regularly, you will soon increase your speed with such tasks and gain a great skill. However, tracing initially can take a lot of time and many don’t prefer to do that. Be that as it may, you can also use an alternative way of tracing and implement tools such as VansPortrait to automatically get a tracing of the image that you upload.

Table of Contents

  • Trace a Picture Without Tracing Paper
    • How to Use VansPortrait?
    • 1. Tracing Paper
    • 2. Thin Paper
    • 3. Baking Paper
    • 4. Mobile Phone Flash Light
    • 5. Use Printer

    Trace a Picture Without Tracing Paper

    If you want to know how to trace a picture from your phone, the VansPortrait online tool is one of the simplest answers. Thanks to its AI and Machine Learning based design, it can automatically read an image and make a tracing picture within a few seconds. You can then use this image in any way you want. This image, for instance, can be the best example to practice drawing with, as you have the ideal tracing to refer to already.

    A really great feature offered by VansPortrait is that it can also convert your image to an anime styled image. This is useful in many ways. It can help you take the next step in your design after you’ve done tracing or give you completely new perspectives on your artworks and drawings. All you need to do is click on the anime option after you have uploaded the image. More interestingly, there are also some popular Vtuber Maker which use similar technology. Try it if you like.

    How to Use VansPortrait?

    1. Use the link above to get to the main page of the tool. The Upload Image button will take you to the VanceAI Workspace, so click there.

    page of VansPortriat

    1. This is where you can use the upload box to select an image for upload or just drag and drop it there. The drop down menu on the right contains the tracing and anime options. Click on Start to Process to proceed.

    Start to process in VansPortrait

    1. Go to Processed > Preview > Download Image to save the image in your device. Apart from that, there comes some fancy AI Portrait Generator, making fancy selfies at a fast speed. Get to know more about it.

    turn photo into line drawing with VansPortrait

    The application is excellent at tracing, especially when it comes to portrait and selfie drawings. The above example has most of the details right though there are some wavy lines here and there but nothing too distracting. This great AI cartoon generator makes cartoonish become an easy thing.

    VanceAI now also launches its software version. VanceAI PC is full-featured desktop software developed by VanceAI that lets you instantly process local photos in bulk with more customization options, which will significantly simplify your workflow and boost your productivity. Free Download

    How to Trace a Picture?

    Let’s go through some useful techniques that you can use for tracing pictures effectively and without much trouble.

    1. Tracing Paper

    One of the most common ways to trace a photo or drawing, a tracing paper can just be the item you need. To get started with this, you will need to place a tracing paper between the drawing and a plain paper. Naturally, the drawing comes first, followed by the tracing paper under it and the plain paper at the bottom.

    Tracing Paper

    Though you need to be careful with tracing paper as too many mistakes can make the result look untidy. Not to mention that you would need to erase and keep drawing lines again and again. The best way is to take it slow and draw small parts at a time.

    2. Thin Paper

    The simple combination of a thin white paper in addition to ample light can do the trick for you as well. All you would need to do is place the thin paper on top of the drawing and get started. However, do make sure there is enough light for you to keep track of each minute detail of the drawing since missing anything can make the final tracing look off.

    Thin Paper

    These papers can be easily bought online or from stores. However, they can tear easily so make sure to gently trace everything and that the light is coming from the right direction.

    3. Baking Paper

    Baking paper is yet another amazing tool to trace a photo with good results. The process for these papers is similar, as you need to place them on top of or under the original drawing. In this case as well, you will need to rest the baking paper on top of the drawing and start tracing it. The paper is thin, so be careful when tracing. Apart from that, you can scratch your pencil on the paper to cover the area of the drawing as this will give you the highlight.

     Baking Paper

    You can get the highlight and follow it along in order to trace it with as much accuracy as possible.

    4. Mobile Phone Flash Light

    Alternatively, you can use any one of the papers suggested on this list and use your flash light as the source for your tracing. Another great way of doing this is to simply have the photo open up on your device and placing a paper on top of the screen. However, the risk here is to press too hard and affect your screen. So, make sure to tread lightly and preferably using this method of simple drawings. If you can do this, it can prove to be one of the quickest and easiest ways of tracing a photo while improving your skill.

    Mobile Phone Flash Light

    5. Use Printer

    The disadvantage of using papers can be that you need to finish tracing a picture from the beginning to the end else you may get confused where to start again. With a printer, you can simply print out your drawing in multiple ways. One, you can get a color print, which will be exactly like the original. Two, you can get a black and white version of it. After that, you can simply use those prints as templates for future projects. Not to mention that printing hardly takes a minute of your time.

    Use Printer

Colin Wynn
the authorColin Wynn

Leave a Reply