Magnetic resonance spectroscopy imaging (MRSI) is an attractive tool for medical imaging. However, its practical use is often limited by the intrinsic low spatial resolution and long acquisition time. Spectral localization by imaging (SLIM) has been proposed as a non-Fourier reconstruction algorithm that incorporates spatial a priori information about spectroscopically uniform compartments. Unfortunately, the influence of the magnetic field inhomogeneity--in particular, the susceptibility effects at tissues' boundaries--undermines the validity of the compartmental model. Therefore, we propose BSLIM as an extension of SLIM with field inhomogeneity compensation. A B0-field inhomogeneity map, which can be acquired rapidly and at high resolution, is used by the new algorithm as additional a priori information. We show that the proposed method is distinct from the generalized SLIM (GSLIM) framework. Experimental results of a two-compartment phantom demonstrate the feasibility of the method and the importance of inhomogeneity compensation.