I am creating a painting application in Actionscript (although my question is not Actionscript related). The basic idea is to start painting when the mouse is press
Mike Bostock has some good examples here Line Simplification. He points out that the Douglas-Peucker algorithm is well know. However Visvalingam appears to be more effective.