The scanning electron microscope (SEM) has become the major imaging technique of choice over many fields of science, providing resolution down to a few nanometers. To reduce surface charging, low beam currents and a few-nm-thick highly conductive metal (Au, Pt) coatings are used. The conceptual problem with the metal coating is that it conceals the sample features which it aims to reveal and the characterised samples are altered. A novel approach to control surface charging in SEM via the photoelectric effect is shown. The technique uses deep-UV co-illumination during SEM imaging. Photons of the deep-UV light have sufficient energy to liberate electrons from the sample surface reducing strong charge gradients. In addition, the method provides a new material dependent contrast modality in SEM. Deep-UV illumination also improves nanoscale 3D structuring using focused ion beam milling. Instead of the metal coating for electron/ion imaging, the newly introduced "coating by light" is introduced. Load-lock mountable sample holder with a deep-UV multiwavelength illumination is conceptualised.