(Abridged) The Spitzer Survey for Stellar Structure in Galaxies (S4G) and its more recently approved extension will lead to a set of 3.6 and 4.5 micron images for 2829 galaxies, which can be used to study many different aspects of the structure and evolution of local galaxies. We collected and re-processed optical images in five bands from the Sloan Digital Sky Survey for 1657 galaxies, which are publicly released with the publication of this paper. We observed, in only the g-band, an additional 111 S4G galaxies in the northern hemisphere with the 2.5 m Liverpool Telescope, so that optical imaging is released for 1768 galaxies, or for 62% of the S4G sample. We visually checked all images. We noted interactions and close companions in our optical data set and in the S4G sample, confirming them by determining the galaxies radial velocities and magnitudes in the NASA-IPAC Extragalactic Database. We find that 17% of the S4G galaxies (21% of those brighter than 13.5 mag) have a close companion (within a radius of five times the diameter of the sample galaxy, a recession velocity within 200km/s and not more than 3 mag fainter) and that around 5% of the bright part of the S4G sample show significant morphological evidence of an ongoing interaction. This confirms and further supports previous estimates of these fractions. The over 8000 science images described in this paper, the re-processed Sloan Digital Sky Survey ones, the new Liverpool Telescope images, the set of 29 false-colour pictures, and the catalogue of companion and interacting galaxies, are all publicly released for general use for scientific, illustrative, or public outreach purposes.