Broadband observations of starlight with a whole sky imager are used for determining the nighttime aerosol optical depth. The main difficulty in such measurements consists of accurately separating the star flux value from the non-stellar diffuse light. The monochromatic extinction at the ground due to aerosols is extracted from heterochromatic measurements. The total error is between 2.6 and 3% rms. Comparison with aerosol optical depth measured by other methods shows good agreement.