The spin configuration in a magnet is in general a "natural" consequence of both the intrinsic properties of the material and the sample dimensions. We demonstrate that this limitation can be overcome in a homogeneous ferromagnetic film by engineering an anisotropy contrast. Substrates with laterally modulated single-crystal and polycrystalline surface regions were used to induce selective epitaxial growth of a ferromagnetic Ni film. The resulting spatially varying magnetic anisotropy leads to regular perpendicular and in-plane magnetic domains, separated by a new type of magnetic wall---the "anisotropy constrained" magnetic wall.