Light quantization for arbitrary scattering systems