Giter Site home page Giter Site logo

depixel's Introduction

This is an implementation of the "Depixelizing Pixel Art" algorithm:

  http://research.microsoft.com/en-us/um/people/kopf/pixelart/

This code is provided under the MIT license, the full text of which is in the
LICENSE file. As far as I know, the algorithm is not covered by any patents or
restrictive copyright.

This is very much a work in progress at present. My primary aim is to build a
tool to generate outline fonts from low-resolution bitmap fonts, but that isn't
ready yet.

So far I have the basic pixel grid deformation, shape outline extraction and
somewhat wonky curve smoothing implemented and I can write representations of
the intermediate steps to PNG and SVG. (The curve smoothing is pretty
experimental, and probably full of exciting bugs. It also operates on each
shape individually, so there's weirdness along the edges.)

There is a handy script to depixel PNGs in the `depixel/scripts` directory, and
there are unit tests covering some of the code.

I like to keep dependencies small and light, but there are some useful bits
I've pulled in (or will pull in) to make life easier:

 * I use `networkx` to do the graph stuff, because implementing it myself was
   getting messy. Switching to a more special-purpose graph library might give
   some performance benefits, but that's fairly low down my priority list at
   present.

 * I use `pypng` to do the PNG reading and writing, but that's isolated in the
   things that need it and the actual depixeling code works fine without it.

 * I use `svgwrite` to do the SVG writing, but that's isolated in the things
   that need it and the actual depixeling code works fine without it.

 * I'm probably going to need `bdflib` once I start working with fonts. Like
   the PNG stuff, I'll restrict its use to the places that need it. Since BDF
   is a fairly simple format and this library doesn't play nice with pip, I may
   rewrite the bits I need here as well.

 * I use Twisted's trial testrunner to run the tests, but that isn't required
   as long as you're happy to figure out how to discover and run the test cases
   yourself. (I think nose or something should work as well. I just like
   Twisted, and I had some editor hooks set up to use trial for other
   projects.)

depixel's People

Contributors

jerith avatar richardbarrell avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.