Mobile app version of vmapp.org
Login or Join
Bryan765

: Is there a way to convert pixel art into vector? I've made some high resolution pixel art in PS by drawing it down at the pixel level and then increasing the image size with the nearest

@Bryan765

Posted in: #AdobePhotoshop #PixelArt

I've made some high resolution pixel art in PS by drawing it down at the pixel level and then increasing the image size with the nearest neighbor setting to keep it crisp. In the web browser, however, I need to display these images as icons with a dynamic size, so I can't just size the images correctly to begin with, and the broswer seems to blur the images when rendering them smaller, while vector images seem to stay more crisp as they shrink.

So I'm wondering if there's a way to convert the pixel art neatly into vector. I'm aware of the trace function in illustrator, but it seems to do a rough job iirc.

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Bryan765

4 Comments

Sorted by latest first Latest Oldest Best

 

@Jessie844

A sneaky way to achieve this faster would be upscaling your pixel art about 100x so you have 100px² pixels, then trying again with Live Trace.

Since the squares are bigger, LT would respect the hard edges, if not, you can configure the parameters decreasing Path, increasing Corners, and setting Noise to 0.

10% popularity Vote Up Vote Down


 

@Berryessa866

Browser rendering

You can use the CSS property image-rendering to stop browsers from applying anti-aliasing and interpolating your image when resized. Browser support is a bit inconsistent though. Some browsers support the pixelated value while others need the crisp-edges value. Internet Explorer instead uses the non-standard -ms-interpolation-mode: nearest-neighbor and Edge apparently has no support at all. Putting it all together you'd need something along the lines of:

.icon {
image-rendering: -webkit-crisp-edges;
image-rendering: -moz-crisp-edges;
image-rendering: crisp-edges;
image-rendering: pixelated;
-ms-interpolation-mode: nearest-neighbor;
}


You can read more here: CSS-Tricks: image-rendering and see specifics on browser support at caniuse here: Can I use... Crisp edges/pixelated images.

Vector

You could use the object mosaic function in Illustrator to convert your pixel art to vectors. This will end up with a bigger file but whether that is too big depends on your requirements and the artwork itself. Take this 30 × 30 pixel smiley face I just drew:



This is the resulting mosiac:



Now, we don't need all of those individual tiles so we can merge a lot of them in to single shapes (using Pathfinder) saving on some of that increased file size. Even similarly colored tiles that aren't connected can be converted to compound paths which would save you a bit of file size. This obviously depends on the artwork itself though.

After merging some of our tiles:



The rusulting SVG (without any optimization) was about 10KB which, although a significant amount bigger than the 4KB the original PNG was, still isn't very big.

10% popularity Vote Up Vote Down


 

@Kimberly620

Illustrator's trace function doesn't give better results in detailed work. You can also try online convertors, if it also don't give you desired result, your last option is make it by yourself.

10% popularity Vote Up Vote Down


 

@Yeniel278

Automatic tracing is possible, but only works for very specialized cases. Having lots of detail or intertwining shapes is poison for a tracing algorithm. In reality if you wish to have a quality vector image you will have to draw that vector image yourself.

For pixel art its possible that you could do a image mosaic (which would always work), then tell svg not to antialias. However this will create a HUGE file and its possible to use other solutions to make the browser not interpolate images with some higher order fliter.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme