Psychostimulants have many effects on visual function, from adverse following acute and prenatal exposure to therapeutic on attention deficit. To determine the impact of prenatal and acute cocaine exposure on visual processing, we studied neuronal responses to visual stimuli in two brain regions of a transgenic larval zebrafish expressing the calcium indicator GCaMP-HS. We found that both red light (LF) and dark (DF) flashes elicited similar responses in the optic tectum neuropil (TOn), while the dorsal telencephalon (dTe) responded only to LF. Acute cocaine (0.5 μM) reduced neuronal responses to LF in both brain regions but did not affect responses to DF. Repeated stimulus presentation (RSP) led to habituation of dTe neurons to LF. Acute cocaine prevented habituation. TOn habituated to DF, but not LF, and DF habituation was not modified by cocaine. Remarkably, prenatal cocaine exposure (PCE) prevented the effects of acute cocaine on LF response amplitude and habituation later in development in both brain regions, but did not affect DF responses. We discovered that, in spite of similar neural responses to LF and DF in the TO (superior colliculus in mammals), responses to LF are more complex, involving dTe (homologous to the cerebral cortex), and are more vulnerable to cocaine. Our results demonstrate that acute cocaine exposure affects visual processing differentially by brain region, and that PCE modifies zebrafish visual processing in multiple structures in a stimulus-dependent manner. These findings are in accordance with the major role that the optic tectum and cerebral cortex play in sustaining visual attention, and support the hypothesis that modification of these areas by PCE may be responsible for visual deficits noted in humans. This model offers new methodological approaches for studying the adverse and therapeutic effects of psychostimulants on attention, and for the development of new pharmacological interventions.