Vision is an important sensory system for most species of fish. Fish eyes are similar to the eyes of terrestrial vertebrates like birds and mammals, but have a more spherical lens. Birds and mammals (including humans) normally adjust focus by changing the shape of their lens, but fish normally adjust focus by moving the lens closer to or further from the retina. Fish retinas generally have both rod cells and cone cells (for scotopic and photopic vision), and most species have colour vision. Some fish can see ultraviolet and some are sensitive to polarized light. Among jawless fishes, the lamprey has well-developed eyes, while the hagfish has only primitive eyespots. The ancestors of modern hagfish, thought to be the protovertebrate were evidently pushed to very deep, dark waters, where they were less vulnerable to sighted predators, and where it is advantageous to have a convex eye-spot, which gathers more light than a flat or concave one. Fish vision shows evolutionary adaptation to their visual environment, for example deep sea fish have eyes suited to the dark environment.
Fish and other aquatic animals live in a different light environment from that of terrestrial species. Water absorbs light so that with increasing depth the amount of light available decreases quickly. The optical properties of water also lead to different wavelengths of light being absorbed to different degrees. For example, visible light of long wavelengths (e.g. red, orange) is absorbed in less water than light of shorter wavelengths (green, blue). Ultraviolet light (even shorter wavelength than violet) can penetrate deeper than visual spectra  Besides these universal qualities of water, different bodies of water may absorb light of different wavelengths due to varying salt and/or chemical presence in the water.
Fish eyes are broadly similar to those of other vertebrates – notably the tetrapods (amphibians, reptiles, birds and mammals – all of which evolved from a fish ancestor). Light enters the eye at the cornea, passing through the pupil to reach the lens. Most fish species seem to have a fixed pupil size, but elasmobranches (like sharks and rays) have a muscular iris which allows pupil diameter to be adjusted. Pupil shape varies, and may be e.g. circular or slit-like.
Lenses are normally spherical but can be slightly elliptical in some species. Compared to terrestrial vertebrates, fish lenses are generally more dense and spherical. In the aquatic environment there is not a major difference in the refractive index of the cornea and the surrounding water (compared to air on land) so the lens has to do the majority of the refraction. Due to "a refractive index gradient within the lens — exactly as one would expect from optical theory", the spherical lenses of fish are able to form sharp images free from spherical aberration.
Once light passes through the lens, it is transmitted through a transparent liquid medium until it reaches the retina, containing the photoreceptors. Like other vertebrates, the photoreceptors are on the inside layer so light must pass through layers of other neurons before it reaches them. The retina contains rod cells and cone cells.
Within the retina, rod cells provide high visual sensitivity (at the cost of acuity), being used in low light conditions. Cone cells provide higher spatial and temporal resolution than rods can, and allow for the possibility of colour vision by comparing absorbances across different types of cones which are more sensitive to different wavelengths. The ratio of rods to cones depends on the ecology of the fish species concerned, e.g., those mainly active during the day in clear waters will have more cones than those living in low light environments. Colour vision is more useful in environments with a broader range of wavelengths available, e.g., near the surface in clear waters rather than in deeper water where only a narrow band of wavelengths persist.
The distribution of photoreceptors across the retina is not uniform. Some areas have higher densities of cone cells, for example (see fovea). Fish may have two or three areas specialized for high acuity (e.g. for prey capture) or sensitivity (e.g. from dim light coming from below). The distribution of photoreceptors may also change over time during development of the individual. This is especially the case when the species typically moves between different light environments during its life cycle (e.g. shallow to deep waters, or fresh water to ocean). or when food spectrum changes accompany the growth of a fish as seen with the Antarctic icefish Champsocephalus gunnari.
Some species have a tapetum, a reflective layer which bounces light that passes through the retina back through it again. This enhances sensitivity in low light conditions, such as nocturnal and deep sea species, by giving photons a second chance to be captured by photoreceptors. However this comes at a cost of reduced resolution. Some species are able to effectively turn their tapetum off in bright conditions, with a dark pigment layer covering it as needed.
The retina uses a lot of oxygen compared to most other tissues, and is supplied with plentiful oxygenated blood to ensure optimal performance.
Humans have a vestibulo-ocular reflex, which is a reflex eye movement that stabilizes images on the retina during head movement by producing an eye movement in the direction opposite to head movement, thus preserving the image on the center of the visual field. In a similar manner, fish have a vestibulo-ocular reflex which stabilizes visual images on the retina when it moves its tail.
Accommodation is the process by which the vertebrate eye adjusts focus on an object as it moves closer or further away. Whereas birds and mammals achieve accommodation by deforming the lens of their eyes, fish and amphibians normally adjust focus by moving the lens closer or further from the retina. They use a special muscle which changes the distance of the lens from the retina. In bony fishes the muscle is called the retractor lentis, and is relaxed for near vision, whereas for cartilaginous fishes the muscle is called the protractor lentis, and is relaxed for far vision. Thus bony fishes accommodate for distance vision by moving the lens closer to the retina, while cartilaginous fishes accommodate for near vision by moving the lens further from the retina.
There is a need for some mechanism that stabilises images during rapid head movements. This is achieved by the vestibulo-ocular reflex, which is a reflex eye movement that stabilises images on the retina by producing eye movements in the direction opposite to head movements, thus preserving the image on the centre of the visual field. For example, when the head moves to the right, the eyes move to the left, and vice versa. In many animals, including human beings, the inner ear functions as the biological analogue of an accelerometer in camera image stabilization systems, to stabilize the image by moving the eyes. When a rotation of the head is detected, an inhibitory signal is sent to the extraocular muscles on one side and an excitatory signal to the muscles on the other side. The result is a compensatory movement of the eyes. Typical human eye movements lag head movements by less than 10 ms.
The diagram on the right shows the horizontal vestibulo-ocular reflex circuitry in bony and cartilaginous fish.
Fish vision is mediated by four visual pigments that absorb various wavelengths of light. Each pigment is constructed from a chromophore and the transmembrane protein, known as opsin. Mutations in opsin have allowed for visual diversity, including variation in wavelength absorption. A mutation of the opsin on the SWS-1 pigment allows some vertebrates to absorb UV light (≈360 nm), so they can see objects to reflect UV light. A wide range of fish species has developed and maintained this visual trait throughout evolution, suggesting it is advantageous. UV vision may be related to foraging, communication, and mate selection.
The leading theory regarding the evolutionary selection of UV vision in select fish species is due to its strong role in mate selection. Behavioral experiments show that African cichlids utilize visual cues when choosing a mate. Their breeding sites are typically in shallow waters with high clarity and UV light penetration. Male African cichlids are largely a blue color that is reflective in UV light. Females are able to correctly choose a mate of their species when these reflective visual cues are present. This suggests that UV light detection is crucial for correct mate selection. UV reflective color patterns also enhance male attractiveness in guppies and three-spined sticklebacks. In experimental settings, female guppies spent significantly more time inspecting males with UV-reflective coloring than those with UV reflection blocked. Similarly, female three-spined sticklebacks preferred males viewed in full spectrum over those viewed in UV blocking filters. These results strongly suggest the role of UV detection in sexual selection and, thus, reproductive fitness. The prominent role of UV light detection in fish mate choice has allowed the trait to be maintained over time. UV vision may also be related to foraging and other communication behaviors.
Many species of fish can see the ultraviolet end of the spectrum, beyond the violet.
Ultraviolet vision is sometimes used during only part of the life cycle of a fish. For example, juvenile brown trout live in shallow water where they use ultraviolet vision to enhance their ability to detect zooplankton. As they get older, they move to deeper waters where there is little ultraviolet light.
The two stripe damselfish, Dascyllus reticulatus, has ultraviolet-reflecting colouration which they appear to use as an alarm signal to other fish of their species. Predatory species cannot see this if their vision is not sensitive to ultraviolet. There is further evidence for this view that some fish use ultraviolet as a "high-fidelity secret communication channel hidden from predators", while yet other species use ultraviolet to make social or sexual signals.
It is not easy to establish whether a fish is sensitive to polarized light, though it appears likely in a number of taxa. It has been unambiguously demonstrated in anchovies. The ability to detect polarized light may provide better contrast and/or directional information for migrating species. Polarized light is most abundant at dawn and dusk. Polarized light reflected from the scales of a fish may enable other fish to better detect it against a diffuse background, and may provide useful information to schooling fish about their proximity and orientation relative to neighbouring fish.
Most fish have double cones, a pair of cone cells joined to each other. Each member of the double cone may have a different peak absorbance, and behavioural evidence supports the idea that each type of individual cone in a double cone can provide separate information (i.e. the signal from individual members of the double cone are not necessarily summed together).
Fishes that live in surface waters down to about 200 metres, epipelagic fishes, live in a sunlit zone where visual predators use visual systems which are designed pretty much as might be expected. But even so, there can be unusual adaptations. Four-eyed fish have eyes raised above the top of the head and divided in two different parts, so that they can see below and above the water surface at the same time. Four-eyed fish actually have only two eyes, but their eyes are specially adapted for their surface-dwelling lifestyle. The eyes are positioned on the top of the head, and the fish floats at the water surface with only the lower half of each eye underwater. The two halves are divided by a band of tissue and the eye has two pupils, connected by part of the iris. The upper half of the eye is adapted for vision in air, the lower half for vision in water. The lens of the eye changes in thickness top to bottom to account for the difference in the refractive indices of air versus water. These fish spend most of their time at the surface of the water. Their diet mostly consists of the terrestrial insects which are available at the surface.
Mesopelagic fishes live in deeper waters, in the twilight zone down to depths of 1000 metres, where the amount of sunlight available is not sufficient to support photosynthesis. These fish are adapted for an active life under low light conditions. Most of them are visual predators with large eyes. Some of the deeper water fish have tubular eyes with big lenses and only rod cells that look upwards. These give binocular vision and great sensitivity to small light signals. This adaptation gives improved terminal vision at the expense of lateral vision, and allows the predator to pick out squid, cuttlefish, and smaller fish that are silhouetted against the gloom above them. For more sensitive vision in low light, some fish have a retroreflector behind the retina. Flashlight fish have this plus photophores, which they use in combination to detect eyeshine in other fish.
Still deeper down the water column, below 1000 metres, are found the bathypelagic fishes. At this depth the ocean is pitch black, and the fish are sedentary, adapted to outputting minimum energy in a habitat with very little food and no sunlight. Bioluminescence is the only light available at these depths. This lack of light means the organisms have to rely on senses other than vision. Their eyes are small and may not function at all.
Deepwater fishes, like this Antarctic toothfish, often have large, upward looking eyes, adapted to detect prey silhouetted against the gloom above. https://handwiki.org/wiki/index.php?curid=1727385
The telescopefish has large, forward-pointing telescoping eyes with large lenses. https://handwiki.org/wiki/index.php?curid=1682297
The mesopelagic sabertooth is an ambush predator with telescopic, upward-pointing eyes. https://handwiki.org/wiki/index.php?curid=1682297
At the very bottom of the ocean flatfish can be found. Flatfish are benthic fish with a negative buoyancy so they can rest on the seafloor. Although flatfish are bottom dwellers, they are not usually deep sea fish, but are found mainly in estuaries and on the continental shelf. When flatfish larvae hatch they have the elongated and symmetric shape of a typical bony fish. The larvae do not dwell on the bottom, but float in the sea as plankton. Eventually they start metamorphosing into the adult form. One of the eyes migrates across the top of the head and onto the other side of the body, leaving the fish blind on one side. The larva loses its swim bladder and spines, and sinks to the bottom, laying its blind side on the underlying surface. Richard Dawkins explains this as an example of evolutionary adaptation
...bony fish as a rule have a marked tendency to be flattened in a vertical direction.... It was natural, therefore, that when the ancestors of [flatfish] took to the sea bottom, they should have lain on one side.... But this raised the problem that one eye was always looking down into the sand and was effectively useless. In evolution this problem was solved by the lower eye ‘moving’ round to the upper side.
Most deep-sea fish cannot see red light. The deepwater stoplight loosejaw produces red bioluminescence so it can hunt with an effectively invisible beam of light. https://handwiki.org/wiki/index.php?curid=1424000
When the larvae of a flatfish grows, the eye on one side rotates to the other side so the fish can rest on the seafloor. https://handwiki.org/wiki/index.php?curid=1118625
The European plaice is a flatfish with raised eyes, so when it buries itself in sand for camouflage it can still see. https://handwiki.org/wiki/index.php?curid=1673665
Prey usually have eyes on the sides of their head so they have a large field of view, from which to avoid predators. Predators usually have eyes in front of their head so they have better depth perception. Benthic predators, like flatfish, have eyes arranged so they have a binocular view of what is above them as they lie on the bottom.
Fish have evolved sophisticated ways of using colouration. For example, prey fish have ways of using colouration to make it more difficult for visual predators to see them. In pelagic fish, these adaptations are mainly concerned with a reduction in silhouette, a form of camouflage. One method of achieving this is to reduce the area of their shadow by lateral compression of the body. Another method, also a form of camouflage, is by countershading in the case of epipelagic fish and by counter-illumination in the case of mesopelagic fish. Countershading is achieved by colouring the fish with darker pigments at the top and lighter pigments at the bottom in such a way that the colouring matches the background. When seen from the top, the darker dorsal area of the animal blends into the darkness of the water below, and when seen from below, the lighter ventral area blends into the sunlight from the surface. Counter illumination is achieved via bioluminescence by the production of light from ventral photophores, aimed at matching the light intensity from the underside of the fish with the light intensity from the background.
Benthic fish, which rest on the seafloor, physically hide themselves by burrowing into sand or retreating into nooks and crannies, or camouflage themselves by blending into the background or by looking like a rock or piece of seaweed.
While these tools may be effective as predator avoidance mechanisms, they also serve as equally effective tools for the predators themselves. For example, the deepwater velvet belly lantern shark uses counter-illumination to hide from its prey.
Epipelagic fish, like this Atlantic bluefin tuna, are typically countershaded with silvery colours. https://handwiki.org/wiki/index.php?curid=1673665
The foureye butterflyfish has false eyes on its back end, confusing predators about which is the front end of the fish. https://handwiki.org/wiki/index.php?curid=1076363
The John Dory has a large eye spot in the middle of its body, confusing prey. https://handwiki.org/wiki/index.php?curid=1367971
Some fish species also display false eyespots. The foureye butterflyfish gets its name from a large dark spot on the rear portion of each side of the body. This spot is surrounded by a brilliant white ring, resembling an eyespot. A black vertical bar on the head runs through the true eye, making it hard to see. This can result in a predator thinking the fish is bigger than it is, and confusing the back end with the front end. The butterflyfish's first instinct when threatened is to flee, putting the false eyespot closer to the predator than the head. Most predators aim for the eyes, and this false eyespot tricks the predator into believing that the fish will flee tail first.
The John Dory is a benthopelagic coastal fish with a high laterally compressed body. Its body is so thin that it can hardly be seen from the front. It also has a large dark spot on both sides, which is used to flash an "evil eye" if danger approaches. The large eyes at the front of the head provide it with the bifocal vision and depth perception it needs to catch prey. The John Dory's eye spot on the side of its body also confuses prey, which is then sucked into its mouth.
Barreleyes are a family of small, unusual-looking mesopelagic fishes, named for their barrel-shaped, tubular eyes which are generally directed upwards to detect the silhouettes of available prey. Barreleyes have large, telescoping eyes which dominate and protrude from the skull. These eyes generally gaze upwards, but can also be swivelled forwards in some species. Their eyes have a large lens and a retina with an exceptional number of rod cells and a high density of rhodopsin (the "visual purple" pigment); there are no cone cells.
The barreleye species, Macropinna microstoma, has a transparent protective dome over the top of its head, somewhat like the dome over an airplane cockpit, through which the lenses of its eyes can be seen. The dome is tough and flexible, and presumably protects the eyes from the nematocysts (stinging cells) of the siphonophores from which it is believed the barreleye steals food.
Another barreleye species, the brownsnout spookfish, is the only vertebrate known to employ a mirror, as opposed to a lens, to focus an image in its eyes. It is unusual in that it utilizes both refractive and reflective optics to see. The main tubular eye contains a lateral ovoid swelling called a diverticulum, largely separated from the eye by a septum. The retina lines most of the interior of the eye, and there are two corneal openings, one directed up and the other down, that allow light into the main eye and the diverticulum respectively. The main eye employs a lens to focus its image, as in other fishes. However, inside the diverticulum the light is reflected and focused onto the retina by a curved composite mirror derived from the retinal tapetum, composed of many layers of small reflective plates possibly made of guanine crystals. The split structure of the brownsnout spookfish eye allows the fish to see both up and down at the same time. In addition, the mirror system is superior to a lens in gathering light. It is likely that the main eye serves to detect objects silhouetted against the sunlight, while the diverticulum serves to detect bioluminescent flashes from the sides and below.
Shark eyes are similar to the eyes of other vertebrates, including similar lenses, corneas and retinas, though their eyesight is well adapted to the marine environment with the help of a tissue called tapetum lucidum. This tissue is behind the retina and reflects light back to it, thereby increasing visibility in the dark waters. The effectiveness of the tissue varies, with some sharks having stronger nocturnal adaptations. Many sharks can contract and dilate their pupils, like humans, something no teleost fish can do. Sharks have eyelids, but they do not blink because the surrounding water cleans their eyes. To protect their eyes some species have nictitating membranes. This membrane covers the eyes while hunting and when the shark is being attacked. However, some species, including the great white shark (Carcharodon carcharias), do not have this membrane, but instead roll their eyes backwards to protect them when striking prey. The importance of sight in shark hunting behavior is debated. Some believe that electro- and chemoreception are more significant, while others point to the nictating membrane as evidence that sight is important. Presumably, the shark would not protect its eyes were they unimportant. The use of sight probably varies with species and water conditions. The shark's field of vision can swap between monocular and stereoscopic at any time. A micro-spectrophotometry study of 17 species of shark found 10 had only rod photoreceptors and no cone cells in their retinas giving them good night vision while making them colorblind. The remaining seven species had in addition to rods a single type of cone photoreceptor sensitive to green and, seeing only in shades of grey and green, are believed to be effectively colorblind. The study indicates that an object's contrast against the background, rather than colour, may be more important for object detection. 
Small fish often school together for safety. This can have visual advantages, both by visually confusing predator fishes, and by providing many eyes for the school regarded as a body. The "predator confusion effect" is based on the idea that it becomes difficult for predators to pick out individual prey from groups because the many moving targets create a sensory overload of the predator's visual channel. "Shoaling fish are the same size and silvery, so it is difficult for a visually oriented predator to pick an individual out of a mass of twisting, flashing fish and then have enough time to grab its prey before it disappears into the shoal." The "many eyes effect" is based on the idea that as the size of the group increases, the task of scanning the environment for predators can be spread out over many individuals, a mass collaboration presumably providing a higher level of vigilance.
Fish are normally cold-blooded, with body temperatures the same as the surrounding water. However, some oceanic predatory fish, such as swordfish and some shark and tuna species, can warm parts of their body when they hunt for prey in deep and cold water. The highly visual swordfish uses a heating system involving its muscles which raises the temperature in its eyes and brain by up to 15 °C. The warming of the retina improves the rate at which the eyes respond to changes in rapid motion made by its prey by as much as ten times.
Some fish have eyeshine. Eyeshine is the result of a light-gathering layer in the eyes called the tapetum lucidum, which reflects white light. It does not occur in humans, but can be seen in other species, such as deer in a headlight. Eyeshine allows fish to see well in low-light conditions as well as in turbid (stained or rough, breaking) waters, giving them an advantage over their prey. This enhanced vision allows fish to populate the deeper regions in the ocean or a lake. In particular, freshwater walleye are so named because their eyeshine.
Many species of Loricariidae, a family of catfish, have a modified iris called an omega iris. The top part of the iris descends to form a loop which can expand and contract called an iris operculum; when light levels are high, the pupil reduces in diameter and the loop expands to cover the center of the pupil giving rise to a crescent shaped light transmitting portion. This feature gets its name from its similarity to an upside-down Greek letter omega (Ω). The origins of this structure are unknown, but it has been suggested that breaking up the outline of the highly visible eye aids camouflage in what are often highly mottled animals.
Visual systems are distance sensory systems which provide fish with data about location or objects at a distance without a need for the fish to directly touch them. Such distance sensing systems are important, because they allow communication with other fish, and provide information about the location of food and predators, and about avoiding obstacles or maintaining position in fish schools. For example, some schooling species have "schooling marks" on their sides, such as visually prominent stripes which provide reference marks and help adjacent fish judge their relative positions. But the visual system is not the only one that can perform such functions. Some schooling fish also have a lateral line running the length of their bodies. This lateral line enables the fish to sense changes in water pressure and turbulence adjacent to its body. Using this information, schooling fish can adjust their distance from adjacent fish if they come too close or stray too far.
The visual system in fish is augmented by other sensing systems with comparable or complementary functions. Some fish are blind, and must rely entirely on alternate sensing systems. Other senses which can also provide data about location or distant objects include hearing and echolocation, electroreception, magnetoception and chemoreception (smell and taste). For example, catfish have chemoreceptors across their entire bodies, which means they "taste" anything they touch and "smell" any chemicals in the water. "In catfish, gustation plays a primary role in the orientation and location of food".
Cartilaginous fish (sharks, stingrays and chimaeras) use magnetoception. They possess special electroreceptors called the ampullae of Lorenzini which detect a slight variation in electric potential. These receptors, located along the mouth and nose of the fish, operate according to the principle that a time-varying magnetic field moving through a conductor induces an electric potential across the ends of the conductor. The ampullae may also allow the fish to detect changes in water temperature.  As in birds, magnetoception may provide information which help the fish map migration routes.