Self-organization is a pervasive phenomenon in nature, observed in large-scale biological and natural systems, and which has inspired the development of robotic swarms with applications to monitoring, manipulation, and construction. The deployment of large-scale swarms not only requires overcoming important technological barriers but also introduces new theoretical challenges for analysis and control. In particular, large groups of agents have some essential characteristics that distinguish them from smaller-scale multi-agent systems. In a large swarm, agents have no individual significance and only the macroscopic objectives are of importance. A swarm largely remains unaffected by the removal of a large, but discrete, number of agents. It may also be infeasible to localize all individual agents in a swarm via a global positioning system. Moreover, it is difficult (and needlessly complicated) to specify the global configuration of the swarm using the states of individual agents; instead, it is more appropriate to employ macroscopic quantities such as a swarm spatial density distribution. In this talk, we present a type of algorithms for the density control of swarms to achieve general 1D and 2D density profiles. In our approach, we view a swarm as a discrete approximation of a (continuous) manifold with density. Under the assumption that agents are able to measure spatial functions of the local density and swarm boundary and motion control is noiseless, the control laws are defined in terms of artificial coordinates that define a diffeomorphism between the spatial domain and a disk. These artificial coordinates are computed in a distributed way through consensus techniques.