Retinitis pigmentosa and macular degeneration lead to photoreceptor death and loss of visual perception. Despite recent progress, restorative technologies for photoreceptor degeneration remain largely unavailable. Here, we describe a novel optogenetic visual prosthesis (FlexLED) based on a combination of a thin-film retinal display and optogenetic activation of retinal ganglion cells (RGCs). The FlexLED implant is a 30 {micro}m thin, flexible, wireless {micro}LED display with 8,192 pixels, each with an emission area of 66 {micro}m2. The display is affixed to the retinal surface, and the electronics package is mounted under the conjunctiva in the form factor of a conventional glaucoma drainage implant. In a rabbit model of photoreceptor degeneration, optical stimulation of the retina using the FlexLED elicits activity in visual cortex. This technology is readily scalable to hundreds of thousands of pixels, providing a route towards an implantable optogenetic visual prosthesis capable of generating vision by stimulating RGCs at near-cellular resolution.