The spectral polarization shaping of ultrashort pulses is shown to allow retrieval of two-dimensional individual tensorial components of the second-harmonic-generation response of molecular samples in nonlinear microscopy imaging. This configuration, which cannot be performed by traditional polarization-controlled excitation, provides a structural contrast that can be directly related to information on the local symmetry and order of the sample, with submicrometric spatial resolution. Phase shaping, in addition to polarization spectral manipulation, is proposed as a possible scheme for imaging individual tensorial components without the need for a spectral information extraction.