The energy band structure of graphene has two inequivalent valleys at the K and K' points of the Brillouin zone. The possibility to manipulate this valley degree of freedom defines the field of valleytronics, the valley analogue of spintronics. A key requirement for valleytronic devices is the ability to break the valley degeneracy by filtering and spatially splitting valleys to generate valley polarized currents. Here, we suggest a way to obtain valley polarization using strain-induced inhomogeneous pseudomagnetic fields (PMFs) that act oppositely on the two valleys. Notably, the suggested method does not involve external magnetic fields, or magnetic materials, unlike previous proposals. In our proposal the strain is due to experimentally feasible nanobubbles, whose associated PMFs lead to different real space trajectories for K and K' electrons, thus allowing the two valleys to be addressed individually. In this way, graphene nanobubbles can be exploited in both valley filtering and valley splitting devices, and our simulations reveal that a number of different functionalities are possible depending on the deformation field.