We present a single pixel terahertz (THz) imaging technique using optical photoexcitation of semiconductors to dynamically and spatially control the electromagnetic properties of a semiconductor mask to collectively form a THz spatial light modulator (SLM). By co-propagating a THz and collimated optical laser beam through a high-resistivity silicon wafer, we are able to modify the THz transmission in real-time. By further encoding a spatial pattern on the optical beam with a digital micro-mirror device (DMD), we may write masks for THz radiation. We use masks of varying complexities ranging from 63 to 1023 pixels and are able to acquire images at speeds up to 1/2 Hz. Our results demonstrate the viability of obtaining real-time and high-fidelity THz images using an optically controlled SLM with a single pixel detector.