Conditions under which various skyrmion objects emerge in experiments on thin magnetic films remain largely unexplained. We investigate numerically centrosymmetric spin lattices in films of finite thickness with ferromagnetic exchange, magnetic anisotropy, and dipole-dipole interaction. Evolution of labyrinth domains into compact topological structures on application of the magnetic field is found to be governed by the configuration of Bloch lines inside domain walls. Depending on the combination of Bloch lines, the magnetic domains evolve into individual skyrmions, biskyrmions, or more complex topological objects. While the geometry of such objects is sensitive to the parameters, their topological charge is uniquely determined by the topological charge of Bloch lines inside the magnetic domain from which the object emerges.