Hacker News new | ask | show | jobs
by kevlar1818 2006 days ago
Shoutout to Michael Fogleman's primitive[1] for likely inspiring this work.

[1]: https://github.com/fogleman/primitive

5 comments

> The algorithm tries to find the single most optimal shape that can be drawn to minimize the error between the target image and the drawn image. It repeats this process, adding one shape at a time. Around 50 to 200 shapes are needed to reach a result that is recognizable yet artistic and abstract.

So one way to think about this is it’s a compression algorithm with aesthetic artifacts at high compression rates.

I wonder if you could use a multi-dimensional Hough-like transform on the primitive of choice to avoid the hill climbing step. You can do this easily with lines, but ellipses and triangles will be more difficult I’m sure. Sounds like a fun Christmas break programming project!

This uses hill climbing to minimize RMS error, I wonder if gradient descent with some momentum would be faster?

Thanks for sharing!

Looks like it’s a recursive minimisation. I wonder what an optimal minimisation would produce.
Indeed, you seem to be correct. It gets a call-out down at the bottom of the page.
Just purchased, thanks.