Potrace and the alphamax 1.334

Index

This item is a slightly edited excerpt from a 2008 blogpost by Pierre Huyghebaert, "Potrace –alphamax 1.334 (or the limit between artificial and natural)"1

Since the first time I’ve used an autotrace program -Adobe Streamline 1.0 in the early nineties- I’ve been disappointed by the unavoidable angles in curves, sometimes named kinks or cusps, that pledged the vector output. Even if some designers were bothered like me, they and some developers seem not to care enough about it to propose a solution. For me it is simply the difference between artificial shapes that scream “I’m a vector!” and natural looking shapes where every sharp edge is a small curve when you look really close. That kind of ultra detail may seem useless and/or nerdy, but it can really make the difference in typography. Like in my work where I use bitmaps as sources.

So for 17 years+, I’ve tried all options and all autotrace softwares I’ve found for that simple but invisible holy grail function : a real smooth aligned anchor for all curves. No way. The only cheat strategy I’ve found was to produce polygons with no curves at all, then to round all them… Sometimes ok, but really not satisfactory.

A few weeks ago, during my first real hands on Inkscape, I’ve made some tests on the Potrace function. That FLOSS package will be more open to custom settings? I founded the “smooth corners” setting, like in so much other packages. After a few tests, with the maximum and strange value of 1.34, it’s reveal to produce those precious precisely aligned anchors! Ma-gni-fi-que.

window

And today, having a bunch of bitmapped pictures to autotrace for a “regular” “proprietary” job, I decided to try potrace more extensively and to try to process them in batch. So I read the potrace documentation, and in a flow of features I read with real emotion :

-a n, --alphamax n set the corner threshold parameter. The default value is 1. The smaller this value, the more sharp corners will be produced. If this parameter is negative, then no smoothing will be performed and the output is a polygon. The largest useful value is 4/3 or 1.334, which suppresses all corners and leads to completely smooth output.2

So the cryptic Alphamax setting, with a 4/3 value define precisely the limit between artificial and organic looking curve in the autotrace and vector world! [...]


  1. Pierre Huyghebaert, Potrace –alphamax 1.334 (or the limit between artificial and natural) (2008) http://ospublish.constantvzw.org/blog/tools/potrace-alphamax-1334-or-the-limit-between-artificial-and-natural 

  2. Potrace http://potrace.sourceforge.net/potrace.1.html