This paper presents a novel computational visual grouping method, termed pulling, pushing and grouping, or PPG for short. Visual grouping is formulated as a functional optimisation process. Our computational function has three terms, the first pulls similar visual cues together, the second pushes different visual cues apart, and the third groups spatially adjacent visual cues without regarding their visual properties. An efficient numerical algorithm based on the Hopfield neural model is developed for solving the optimisation process. Experimental results on various intensity, colour and texture images demonstrate the effectiveness of the new method.