Pixilated spatial light modulators are efficient devices to shape the wavefront of a laser beam or to perform Fourier optical filtering. When conjugated with the back focal plane of a microscope objective, they allow an efficient redistribution of laser light energy. These intensity patterns are usually polluted by undesired spots so-called ghosts and zero-orders whose intensities depend on displayed patterns. In this work, we propose a model to account for these discrepancies and demonstrate the possibility to efficiently reduce the intensity of the zero-order up to 95%, the intensity of the ghost up to 96% and increase diffraction efficiency up to 44%. Our model suggests physical cross-talk between pixels and thus, filtering of addressed high spatial frequencies. The method implementation relies on simple preliminary characterization of the SLM and can be computed a priori with any phase profile. The performance of this method is demonstrated employing a Hamamatsu LCoS SLM X10468-02 with two-photon excitation of fluorescent Rhodamine layers.