In this paper a powerful image analysis technique based on the multivariate analysis of photon spectra coming from a Compton scattering process is presented to study the electronic density of a phantom model simulating a homogeneous background material with insertion of different composition. The photon spectra have been measured by the Enhanced Compton Spectrometer (ECoSp) device performing a voxel-by-voxel linear scan of phantom models simulating both the homogeneous and inhomogeneous material composition. Some spectral energy windows containing either or both inelastic and elastic scattered photons have been selected and collected in a single multivariate data matrix X. The Multivariate Image Analysis (MIA) of the matrix X allows one to indicate the presence of heterogeneous materials in a given voxel by dissecting its contribution from the overall variability of the data matrix. The MIA leads to a series of images that describes the sample elemental composition.