This paper presents a new passive shim design method and a novel shimming procedure to correct the magnetic field inhomogeneities generated by C-shape permanent biplanar magnetic resonance imaging magnets. The method expresses the shim distribution as a sum of orthogonal functions multiplied by unknown amplitudes. The oscillating modes of the shim magnetization-thickness function are normalized within a finite disk. By minimizing the shim set weight and constraining the magnetization-thickness function, the method produces a continuous map of the required shim contribution. The map defines the shim shape and a discrete process then determines the regions where no shim contributions are needed. With this methodology, passive shims capable of generating magnetic field harmonics with minimal impurities and ferro-shim pieces can be generated. The paper reports a study of magnetic coupling among the iron pieces and its influence over the magnetic field harmonics of linear and nonlinear iron, and demonstrates that the exclusion of the magnetic coupling in the shimming process produces an unacceptable error in the final shimmed field homogeneity. The proper selection and arrangement of individual shim sizes produces a better conditioned field source matrix and hence improves the design. A number of examples show that the new method can effectively cancel target impurity harmonics while controlling high-order harmonics.