This sounds interesting. The ability to specify tool diameter and pick distance would be nice. I noticed in your PHP code that you step one way through the image array. This is not good because at the end of one line it will gouge through the part to get to the start of the next line (potentially anyways). It would be better to scan through a line, move to the next line and go through that one in the reverse direction. That way you get no gouging.
I might code up something like this myself. I've got a C backend
VB front end program that I wrote a while back that does some nifty CNC operations plus does some research related things (like creating octrees and visualizing them in OpenGL). I might try to add something like this to it. Or maybe I'll make it a seperate program.
I hope you don't mind if I try to do what you are doing but in C instead of PHP. A neat thing you might be able to do is make your PHP code accessable over a website so that people can upload their PNG files and get the GCODE output right over the internet. That'd be COOL.