We theoretically investigate the optical response of ensembles of polarizable metallic nanoparticles (NPs) that form (1) submonolayer films of particles adsorbed on a dielectric substrate, considered as two-dimensional (2-D) systems, and (2) thin three-dimensional (3-D) films, where NPs are embedded in a dielectric matrix. For system (1), the effect of NPs’ distance to the substrate is taken into account. In both cases, we find that short-range clustering leads to a broadening and a spectral shift of the absorption band related to the surface plasmon resonance (SPR) in individual NPs. We show that the clustering can help in achieving spectrally broad SPR bands, especially if NPs aggregate into fractal clusters, which can be interesting for some applications such as surface-enhanced Raman scattering. In particular, submonolayer films on NPs generated using the diffusion-limited aggregation algorithm produce sizable and spectrally broad absorption, which can be tuned to the visible range by choosing an appropriate capping and/or substrate material. Calculated results for thin 3-D films are compared with experimental data obtained for Au/TiO2 nanocomposite layers produced by reactive cosputtering.