News for hackers. Stuff that matters.
Re:Show HN: αlphaPun.ch by slig on Monday September 12, 2011 @03:54PM (#2988649)
I had to do something similar once. I ended up using ImageMagick and ptrace get a nice "silhouette" of my image and use the generated data to draw a path using Raphael.

convert IMAGE.png -channel matte -separate +matte -flip ppm:- | potrace -k 0.95 -u 1 -s

Re:Show HN: αlphaPun.ch by newtron on Monday September 12, 2011 @03:57PM (#2988667)
That's interesting, I'll definitely take a look at Raphael. Did you just need the silhouette, or did Raphael let you do the click through thing too?
Re:Show HN: αlphaPun.ch by slig on Monday September 12, 2011 @04:20PM (#2988735)
I was able to do the click through using the invisible path. The project was a kind of weird puzzle, so the click through was a must.

I upped my prototype here: http://dl.dropbox.com/u/491131/puzzle/puzzle.html You can only drag the camel.

Eventually I gave up because I wasn't able to drag the piece correctly if it was rotated.

Re:Show HN: αlphaPun.ch by newtron on Monday September 12, 2011 @05:22PM (#2988963)
That's awesome, thanks for showing me that. It would definitely be cool to implement something similar for browsers with SVG support, then fallback to the generated spans for those without.
Re:Show HN: αlphaPun.ch by slig on Monday September 12, 2011 @05:28PM (#2988976)
Raphael is so awesome that it works even on IE, using VML, with the same sane API.