DrPTrace - A New Vector Tracing Library for Java
Vector tracing to vectorize a raster bitmap image of a smiley face

DrPTrace - A New Vector Tracing Library for Java

I was frustrated by the lack of vectorization libraries for Java, so I made one all by myself. I plan to use it in other Java projects where I'd rather output an SVG image instead of a PNG image.

How does it work? It's actually not that complicated. DrPTrace uses a "flood fill" algorithm to identify patches of color, and then traces around the outer edge of each patch, saving a dotted path. It then divides the dotted paths into a number of bezier curves, and jiggles the bezier curve control points until the best fit is achieved. And voila! A vectorized image.

While not as clever as Peter Selinger's PoTrace program, DrPTrace is a lightweight pure-Java library that you can easily embed in your Java programs.

Link to the GitHub page below:


To view or add a comment, sign in

More articles by Christopher Hall

  • Simple-SI-Units: a scientific units library for Rust

    I've just completed a new library for Rust, simple-si-units, which provides SI units as data types, so you can use…

  • Fixing Git, Part 2

    Previous post in series: Fixing Git, Part 1 | Next post in series: coming soon Part 2: Making Git Good In Part 1 of…

  • Fixing Git, Part 1

    Next post in series: Fixing Git, Part 2 Part 1: Git Sucks I am embarking on a quest to fix the distributed version…

  • What’s this bug on my office plant?

    I’ve noticed little tiny bugs on my favorite office plant, and decided to investigate (A). My office plant is a small…

Explore content categories