
The final algorithm I settled on is a non-linear scheme that sets the height of the inflation of a 2D image at a given point in the image x by approximating the Lp norm (E(Txp))1/p of the exit time Tx of a random walk started at x. For further adjustment, you can replace Tx with min(Tx,K) where K is exponentially distributed, which flattens the inflation in inner regions. The code could use a lot of optimization (using pypy instead of cpython improves runtimes by a factor of 10, but Inkscape only bundles python) as on my laptop the code takes about 45 seconds with default settings on one of my simple test images.
While my original Valentine's day card used p=1, I have since found that p=2 produces more nicely rounded output.
No comments:
Post a Comment