Most neurons transmit information digitally using spikes that trigger the release of synaptic vesicles with low probability. The first stages of vision and hearing are distinct in that they operate with analog signals, but it is unclear how these are recoded for synaptic transmission. By imaging the release of glutamate in live zebrafish, we demonstrate that ribbon synapses of retinal bipolar cells encode contrast through changes in both the frequency and amplitude of release events. Higher contrasts caused multiple vesicles to be released within an event, and such coding by amplitude often continued after the rate code had reached a maximum frequency. Glutamate packets equivalent to five vesicles transmitted four times as many bits of information per vesicle compared with those released individually. By discretizing analog signals into sequences of numbers up to about 11, ribbon synapses can increase the dynamic range, temporal precision and efficiency with which visual information is transmitted.