16. A non-transitory computer-readable storage medium storing program instructions that when executed on one or more computers cause the one or more computers to perform acts comprising: collecting information about a user manipulation of a stylus indicative of six degrees of freedom movement of the stylus relative to an initial position of the stylus in three-dimensional space relative to a touch input surface and information regarding touch or pressure input applied to the touch input surface; recognizing, from the collected information, a stylus gesture performed by the user via manipulation of the stylus, wherein the stylus gesture is one of a plurality of stylus gestures that are recognized by the one or more computers to perform at least one of a plurality of actions in a graphics application, and the plurality of stylus gestures includes a twisting motion, a waving motion above the touch input surface, a brush switching gesture in which a proximity of the stylus relative the touch input surface is changed with at least a rate of change that corresponds to the brush switching gesture and changes from the initial position relative the touch input surface that is within a first pre-defined distance threshold of the touch input surface to an ending position that is further away from the touch input surface and beyond a second pre-defined distance threshold, a quick motion toward the touch input surface, shaking the stylus directed away from the touch input surface, or shaking the stylus directed towards the touch input surface; determining which of the plurality of actions to perform based on the recognized stylus gesture, wherein an action of switching between paintbrushes of a brush tool is performed in response to recognition of the brush switching gesture; and performing a painting function for a digital image in the graphics application including performing the determined actions.
17. The storage medium of claim 16 , wherein the collected information comprises information about the manipulation of the stylus in relation to a tablet device having the touch input surface.