A novel mathematical approach has been developed to complete the inversion of the Biot-Savart law in one- and two-dimensional cases from measurements of the perpendicular component of the magnetic field using the well-developed Magneto-Optical Imaging technique. Our approach, especially in the 2D case, is provided in great detail to allow a straightforward implementation as opposed to those found in the literature. Our new approach also refines our previous results for the 1D case [Johansen et al., Phys. Rev. B 54, 16264 (1996)], and streamlines the method developed by Jooss et al. [Physica C 299, 215 (1998)] deemed as the most accurate if compared to that of Roth et al. [J. Appl. Phys. 65, 361 (1989)]. We also verify and streamline the iterative technique, which was developed following Laviano et al. [Supercond. Sci. Technol. 16, 71 (2002)] to account for in-plane magnetic fields caused by the bending of the applied magnetic field due to the demagnetising effect. After testing on magneto-optical images of a high quality YBa2Cu3O7 superconducting thin film, we show that the procedure employed is effective.