Formation and deformation of patterns through diffusion