The energy density of thin films via dimension reduction