3 ms·
Shapeme – Evolve images using simulated annealing
- antirez 12y agoContext: https://news.ycombinator.com/item?id=8710147 https://news.ycombinator.com/item?id=8710147
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]
- JohnHaugeland 12y agoNeat. I did one of these too, a while back: https://github.com/StoneCypher/canvolver https://github.com/StoneCypher/canvolver
- tekni5 12y agoVery cool, easy to test as well.
- elwell 12y agoYou don't have to be so self-deprecating of your code quality.
- throwaway823734 12y agoAlthough in this case, to be honest, the code is not that great. Lots of repetition/noise-- plenty of opportunity for factoring.
- antirez 12y agoYep... it was created like: let's try this, let's try this, hey cool! And abandoned. No refactoring, and this means also that to try new strategies is boring because most of the code is not ready to change parameters easily. Should not be too hard to refactor it, I waited to do this before the release, and I waited 6 years, so I released it :-)
- bkirwi 12y agoIf you find yourself creating a throwaway just so you can criticize someone's coding style on a quick graphics experiment, you may want to reconsider your life choices.
- possibilistic 12y agoHe didn't criticize just anyone. He criticized antirez. Google him. :) Good work on this, btw. I'd be super ashamed to release the one I wrote (I was in university at the time, though that's no excuse).
- antirez 12y agonp I'm a strong believer in internet anonymity ;-) And btw the user was not mean, there are people on Twitter that with their real names are very offensive, so probably not just a matter of being anonymous or not (but that plays a role also, indeed).
- antirez 12y agoOk refactored it a bit! At least the obvious things. I hope I did not broken anything since there are no tests in the program, but looks like it's working as before.
- phkahler 12y agoNow do video compression with it. Do the first frame just like this, then start with that as the first generation to evolve the next frame and so on. Maybe have a way to dynamically vary the number of triangles - especially when the scene changes, you may even want to discard everything and start over if the first generation on a frame is a bad fit. Resolution independent video compression at last ;-)
- based2 12y agohttp://www.arte.tv/guide/fr/044053-000/la-joconde-devoilee?autoplay=1?autoplay=1 http://www.arte.tv/guide/fr/044053-000/la-joconde-devoilee?a...
- fogleman 12y agoI also used simulated annealing for this problem. But I only added one triangle at a time. http://stackoverflow.com/questions/3848108/reproducing-images-with-primitive-shapes-graphics-optimization-problem http://stackoverflow.com/questions/3848108/reproducing-image... I'll see if I can dig up the code. It's a fun problem. I still think about it a lot.
- MasterScrat 12y agoFYI this is from the guy who makes Redis.