Direct numerical simulation of diffusion through heterogeneous media can be difficult due to the computational cost of resolving fine-scale heterogeneities. One method to overcome this difficulty is to homogenize the model by replacing the spatially-varying fine-scale diffusivity with an effective diffusivity calculated from the solution of an appropriate boundary value problem. In this paper, we present a new semi-analytical method for solving this boundary value problem and computing the effective diffusivity for pixellated, locally-isotropic, heterogeneous media. We compare our new solution method to a standard finite volume method and show that equivalent accuracy can be achieved in less computational time for several standard test cases. We also demonstrate how the new solution method can be applied to complex heterogeneous geometries represented by a two-dimensional grid of rectangular blocks. These results indicate that our new semi-analytical method has the potential to significantly speed up simulations of diffusion in heterogeneous media.