Energy such as light is transformed to chemical energy and activity in receptors in a process called transduction. This process change the firing rate of ganglions, neurons that transfer information from the eye to the brain, the information passes along these neurons first to the Optic Chiasm, then the thalamus ( the sensory relay station deep in the brain and then to the primary visual cortex in the occipital lobe for further processing.
You can read about this more in there https://nba.uth.tmc.edu/neuroscience/m/s2/chapter14.html