  We demonstrate the arbitrary control of the density profile of a
two-dimensional Bose gas by shaping the optical potential applied to the atoms.
We use a digital micromirror device (DMD) directly imaged onto the atomic cloud
through a high resolution imaging system. Our approach relies on averaging the
response of many pixels of the DMD over the diffraction spot of the imaging
system, which allows us to create an optical potential with arbitrary grey
levels and with micron-scale resolution. The obtained density distribution is
optimized with a feedback loop based on the measured absorption images of the
cloud. Using the same device, we also engineer arbitrary spin distributions
thanks to a two-photon Raman transfer between internal ground states.
