A portable 3He gas polarizer based on metastability exchange optical pumping is described. It produces 75 ml of highly polarized 3He gas at the pressure of 100 mbar, by implementing a non-magnetic peristaltic compressor, which transfers the 3He gas from the low-pressure optical pumping cell to the storage cell. About 30% polarization at 1 mbar is achieved in the optical pumping cell in a single run, and 20 compression cycles are needed to reach the final pressure in the storage cell. After adding a buffer gas up to the atmospheric pressure, the mixture is used in magnetic resonance imaging (MRI) experiments. Preliminary images of phantoms and of the rat lungs in vivo confirm the usefulness of the 3He gas polarizer in MRI applications.