Multispectral camera filter design

To calculate our target filter spectra, we calculated typical spectral sensitivities of avian cones and then divided these spectra by the spectral sensitivities/transmittances of the other components of the camera system, which was based on PIXELTEQ’s UV-VIS Spectrocam (Largo, FL, USA). Using the data tabulated in Hart and Vorobyev6, we calculated the mean wavelength of peak sensitivity for the opsin in each avian cone class (U, V, S, M, L), and used these wavelengths to generate opsin spectral sensitivity curves following Govardovskii et al.20. Next, we calculated the mean wavelength of 50% peak absorptance (λ mid ) of each oil droplet class, including a separate mean for each of the two variants that can be paired with the S (blue)-cone class. For each mean λ mid , we calculated the corresponding λ cut and then the spectral transmittance of each oil droplet using the template equations developed by Hart and Vorobyev6. Mean optical media transmittance spectra for birds having each variant of the UV-cone class (U and V) were calculated from the data tabulated in Lind et al.21.

We calculated the desired spectral sensitivity of each multispectral camera channel by multiplying each opsin curve by its associated oil droplet and ocular media transmittance spectra. For the M- and L-cones, we used the mean of the U and V optical media transmittance spectra. To obtain our target filter transmittance spectra, we divided these target spectral sensitivities by the quantum efficiency spectrum of the camera sensor (JAI CM-140 GE-UV, Kushima City, Japan), by the transmittance spectrum of the lens (Jenoptik CoastalOpt UV-VIS-IR 60 mm 1:4 Apo Macro, Jupiter, FL, USA), and by an infrared blocking filter mounted on the front of lens (commissioned from Knight Optical, Kent, UK)). Thus,

$$S_i\left( \lambda \right)T_i\left( \lambda \right)T_{{\mathrm{m}},i}\left( \lambda \right) = F_{{\mathrm{target}},i}\left( \lambda \right)S_{{\mathrm{sensor}}}\left( \lambda \right)T_{{\mathrm{lens}}}\left( \lambda \right)T_{{\mathrm{IRblock}}}\left( \lambda \right)$$ (1)

where

S i (λ) = spectral sensitivity of cone class i,

T i (λ) = spectral transmittance of oil droplet associated with cone class i,

T m,i (λ) = spectral transmittance of optical media (lens, cornea, vitreous fluid) associated with cone class i,

F target,i (λ) = target spectral transmittance of multispectral camera filter,

S sensor (λ) = spectral sensitivity of camera sensor,

T lens (λ) = spectral transmittance of camera lens, and

T IRblock (λ) = spectral transmittance of infrared blocking filter.

PIXELTEQ (Largo, FL, USA) fabricated filters according to our calculated F target,i (λ). A comparison of avian spectral sensitivities and the effective spectral sensitivities of each camera channel is depicted in Fig. 1.

Habitat sampling and photography

We captured 173 sets of six photographs (one through each of six filters) of terrestrial vegetated habitats, including deciduous habitats in southern Sweden (43 sets) and wet schlerophyll (50 sets) and rainforest (80 sets) habitats in Queensland, Australia. Details of field sites can be found in Supplementary Table 1. Photographs were taken at assorted field sites on calm days or portions of the day to minimize noise due to wind-induced motion of branches and leaves. Field excursions were planned to maximize the range of lighting conditions sampled, from overcast to clear skies, and from dawn to dusk. For each scene sampled, the position and direction of the camera was selected in a pseudo-random fashion designed to maximize the range of habitat and lighting conditions sampled, including, when possible, different heights in the canopy, assisted by canopy towers, walks, bridges, etc. Photographs of deciduous habitats were limited to the months of June, July, and August to avoid any confounding effects of leaf senescence. When the dynamic range of the camera was insufficient to capture much of the dynamic range of the scene, multiple sets of photographs were taken at different exposures and combined later, in MATLAB, to create high dynamic range images.

Quantifying leaf-contrast from photographs

The output of the camera sensor of the UV-VIS Spectrocam scaled linearly with light intensity; thus, no non-linearity corrections were required. Dark noise was constant across exposures and was subtracted from all pixel values. Each pixel value of a photograph taken through a given filter represented the quantum catch by a single cone class at a single point in space. To adapt quantum catches to the intensity of the background11, each pixel value was normalized by the mean of all pixel values in the photograph. Each set of six photographs was then opened using the software Evince (Prediktera, Umeå, Sweden). Within this program, we hand-selected all upper leaf surfaces and all lower leaf surfaces, selecting the same pixels across all six photographs. Each species of plant was selected separately. We exported the indices of the selected pixels and then imported them into MATLAB, which we used to calculate the median quantum catch of each plant’s upper leaf surfaces and the median quantum catch of each plant’s lower leaf surfaces across each photograph. These medians were then used to calculate Michelson contrast10 and just noticeable differences (JNDs)11 between the upper and lower leaf surfaces of each plant. JNDs were calculated with log transformation of quantum catches11. For our comparison between LMSU and LMSV birds, Weber fractions were calculated from estimates of noise-to-signal ratios22,23 and cone fractions24,25,26,27,28 in terrestrially foraging birds. Weber fractions used were the following: U and V: 0.12, S: 0.092, M: 0.075, L: 0.069. For our comparison between tetrachromats and theoretical trichromats and dichromats (Fig. 5b), we wanted to maximize the generality of our findings across the animal kingdom, so we assumed that the same number of each photoreceptor class contributed to an integrative unit, and set all Weber fractions to 0.069.

If some leaves in an image were illuminated by direct sunlight, these leaves were selected and analyzed separately. If there were any over- or underexposed pixels in any channel, these pixels were excluded from all calculations across all channels. Selected normalized pixel values and their associated metadata can be downloaded as a JSON file at https://figshare.com/ under the DOI 10.6084/m9.figshare.7423532.

Optical model input parameters

To determine typical diffuse spectral reflectances and transmittances of live leaves, we measured these properties from 17 deciduous leaves collected from the Lund University campus, and from 16 rainforest leaves collected from the Lund University Botanical Garden greenhouse in mid-June. The deciduous species sampled were: Acer platanoides, Alnus incana, Betula pubescens, Cornus sanguinea, Corylus avellana, Crataegus laevigata, Crataegus monogyna, Fagus sylvatica, Fallopia dumetorum, Malus spp., Prunus padus, Quercus rubra, Rhamnus cathartica, Rosa spp., Sorbus aucuparia, and Taraxacum pallidipes. The rainforest species sampled were: Aglaonema nitidum, Anchomanes difformis, Arpophyllum giganteum, Artocarpus altilis, Bambusa vulgaris, Camillia japonica, Corynocarpus laevigatus, Encephalartus ferox, Epipremnum pinnatum, Myriocarpa spp., Passiflora quadrangularis, Psidium cattleianum, Syngonium podophyllum, and Theobromum cacao.

To determine a typical leaf litter reflectance spectrum, we measured the diffuse spectral reflectances of both surfaces of 17 dry leaves found in leaf litter on campus and in parks in Lund, Sweden. Dead leaves were not identified to species, but visual inspection indicated that they all had come from different species.

Diffuse reflectance was measured with a reflection probe, oriented at 45° to the leaf surface, connected to a USB2000 + UV-VIS-ES spectrometer and a DH-2000 light source (both from Ocean Optics, Dunedin, FL, USA). Transmittance was measured with an integrating sphere (Electro Optical Industries Inc., Santa Barbara, CA, USA) connected to a USB2000 + UV-VIS-ES spectrometer, with a clear blue sky as a light source. For each class of spectra, we calculated the median spectrum to use as model input (Supplementary Figure 1a).

We used the American Society for Testing and Materials’ (ASTM) standard terrestrial irradiance spectra as light sources in our optical model. These include direct normal solar irradiance I s for a sun 42° from the zenith, and hemispherical irradiance I a for light incident on a surface tilted 37° toward the same sun under clear skies. Clear sky hemispherical irradiance I b was calculated by subtracting I s from I a . Overcast sky irradiance was calculated from I b and I s following the parameterizations of Siegel et al.29 using a total cloud index \(\overline {CL}\) of 0.8, which is typical of overcast conditions, to calculate a spectral cloud index \(\widehat {cl}\),

$$\widehat {cl}\left( {\lambda ;\overline {CL} } \right) = A\left( {\overline {CL} } \right)\lambda + B(\overline {CL} )$$ (2)

where \(A\left( {\overline {CL} } \right)\) and \(B\left( {\overline {CL} } \right)\) are defined as:

$$A\left( {\overline {CL} } \right) = 0.00150\overline {CL} (1 - \overline {CL} )$$ (3)

and

$$B\left( {\overline {CL} } \right) = 0.966\overline {CL} ^2 + 0.0619\overline {CL} - 0.0389$$ (4)

To obtain hemispherical irradiance for an overcast sky I c , the spectral cloud index \(\widehat {cl}\) was multiplied by hemispherical irradiance under a clear sky29. Hemispherical irradiance under a clear sky I cs was first calculated by adding clear sky irradiance I b to solar irradiance I s weighted by the cosine of solar zenith angle θ z ,

$$I_{{\mathrm{cs}}}\left( \lambda \right) = I_{\mathrm{b}}\left( \lambda \right) + I_{\mathrm{s}}\left( \lambda \right)\cos {\theta _{\mathrm{z}}}$$ (5)

with I c then calculated as:

$$I_{\mathrm{c}}\left( \lambda \right) = I_{{\mathrm{cs}}}\left( \lambda \right)\widehat {cl}\left( {\lambda ;\overline {CL} } \right)$$ (6)

Sun, cloud, and sky hemispherical irradiance spectra under a solar zenith angle of zero are shown in Supplementary Figure 1b. Sky and cloud radiances per steradian were estimated10 by dividing their irradiances by pi. Although the intensity of cloud and sky radiance can vary depending on the position of the sun and on cloud density and thickness, we found that independently varying sky and cloud radiant intensities had no major effects on the output of our optical model (i.e., the difference in leaf-contrast seen by the two avian UV-cone variants).

Optical model calculations

The optical model was programmed to repeat its calculations of U- and V-cone leaf-contrast 10,000 times, with 12 parameters that, unless otherwise stated, were randomized each time to account for natural variation in habitat geometry and environmental conditions. Randomized parameters included (1) solar zenith angle, (2) vertical tilt of the leaves whose contrast was being calculated, (3) azimuth of the sun relative to the direction of the viewer’s gaze, (4) cloud cover, (5) whether the leaves whose contrast was being calculated were in the sun or shade, (6) proportion of the sky occluded by overlying canopy, (7) occlusion of the sun by clouds, (8) proportion of the ground (i.e., leaf litter) visible through underlying vegetation, (9) the identity of the specular light source reflected from the leaf’s upper surface (could be light radiating from the sky, clouds, or overlying canopy), (10) the identity of the specular light source reflected from the leaf’s lower surface (could be light radiating from the underlying canopy or leaf litter), (11) whether the specular light source in (10) was illuminated by direct sunlight, and (12) whether deciduous or rainforest leaf spectra were used. When each of these parameters is defined in the equations that follow, its corresponding number in this list is displayed parenthetically.

For simplicity, the avian viewer’s gaze was assumed to be horizontal, i.e., perpendicular to the direction of the zenith (Supplementary Figure 1c). The model calculated achromatic contrast between the upper and lower surfaces of two identical leaves, side by side, one with its upper surface tilted toward the observer, and the other with its upper surface tilted away from the observer. The tilt angle θ l of the two leaves relative to the zenith was the same within a given iteration and could range between 70 and 90°. For simplicity, all other reflective surfaces in the forest (other leaves in the canopy and leaf litter) were assumed to be oriented horizontally.

When no overhead objects (canopy, clouds) blocked direct sunlight, the model calculated the angles of incidence, θ s , of the sun upon the upper surface of each of the two leaves. To do this, we followed:

$${\bar{\mathbf n}} = \left[ {\begin{array}{*{20}{c}} 0 & 0 & 1 \end{array}} \right]\left[ {\begin{array}{*{20}{c}} 1 & 0 & 0 \\ 0 & {\cos \theta _{\mathrm{l}}} & { - \sin \theta _{\mathrm{l}}} \\ 0 & {\sin \theta _{\mathrm{l}}} & {\cos \theta _{\mathrm{l}}} \end{array}} \right]\left[ {\begin{array}{*{20}{c}} 1 & 0 & 0 \\ 0 & {\cos 90} & { - \sin 90} \\ 0 & {\sin 90} & {\cos 90} \end{array}} \right]$$ (7)

$${\bar{\mathbf r}} = \left[ {\begin{array}{*{20}{c}} 0 & 0 & { - 1} \end{array}} \right]\left[ {\begin{array}{*{20}{c}} 1 & 0 & 0 \\ 0 & {\cos - \theta _{\mathrm{z}}} & { - \sin - \theta _{\mathrm{z}}} \\ 0 & {\sin - \theta _{\mathrm{z}}} & {\cos - \theta _{\mathrm{z}}} \end{array}} \right]\left[ {\begin{array}{*{20}{c}} {\cos - \gamma _{\mathrm{s}}} & { - \sin - \gamma _{\mathrm{s}}} & 0 \\ {\sin - \gamma _{\mathrm{s}}} & {\cos - \gamma _{\mathrm{s}}} & 0 \\ 0 & 0 & 1 \end{array}} \right]$$ (8)

$$\theta _{\mathrm{s}} = \cos ^{ - 1}\left( {{\bar{\mathbf r}} \cdot {\bar{\mathbf n}}} \right)$$ (9)

where

θ z = solar zenith angle (parameter #1),

θ l = tilt angle of leaf relative to the zenith (parameter #2), and,

when the upper surface of the leaf was tilted towards the observer,

\(\gamma _{\mathrm{s}}\) = azimuth of the sun relative to the direction of the viewer’s gaze (parameter #3), and,

when the upper surface of the leaf was tilted away from the observer,

\(\gamma _{\mathrm{s}}\) = \(\gamma _{\mathrm{s}} - 180^\circ\).

If \(\theta _{\mathrm{s}}\) was ≥90°, this meant that the angle of the sun relative to the leaf was such that the sun missed the leaf. When this happened, the directness of the sun’s illumination on the leaf \(d\) (defined and implemented below) was set to zero.

Downwelling spectral irradiance incident upon the upper surface of the leaf tilted toward the observer was then approximated from the spectra obtained in the previous section by calculating the relative contributions of direct skylight, cloud light, sunlight, and light filtered through leaves:

$$I_{{\mathrm{sky}}}\left( \lambda \right) = \left( {\left( {1 - p_{\mathrm{c}}} \right) - p_{\mathrm{l}}\left( {1 - p_{\mathrm{c}}} \right)} \right)I_{\mathrm{b}}\left( \lambda \right)$$ (10)

$$I_{{\mathrm{cld}}}\left( \lambda \right) = \left( {p_{\mathrm{c}} - p_{\mathrm{c}}p_{\mathrm{l}}} \right)I_{\mathrm{c}}\left( \lambda \right)$$ (11)

$$I_{{\mathrm{sun}}}\left( \lambda \right) = dp_{\mathrm{s}}I_{\mathrm{s}}\left( \lambda \right)\cos {\theta _{\mathrm{s}}}$$ (12)

$$I_{\mathrm{t}}\left( \lambda \right) = p_{\mathrm{l}}\left( {\left( {1 - p_{\mathrm{c}}} \right)I_{\mathrm{b}}\left( \lambda \right) + p_{\mathrm{c}}I_{\mathrm{c}}\left( \lambda \right) + p_{\mathrm{s}}I_{\mathrm{s}}\left( \lambda \right)\cos \theta _{\mathrm{z}}} \right)T\left( \lambda \right)$$ (13)

and then summing these contributions to obtain total downwelling spectral irradiance incident upon the leaf:

$$I_{{\mathrm{down}}}\left( \lambda \right) = I_{{\mathrm{sky}}}\left( \lambda \right) + I_{{\mathrm{cld}}}\left( \lambda \right) + I_{{\mathrm{sun}}}\left( \lambda \right) + I_{\mathrm{t}}\left( \lambda \right)$$ (14)

where

p c = proportion of the sky occluded by clouds (parameter #4),

I b = downwelling irradiance of blue sky,

I c = downwelling irradiance of cloudy sky,

d = indicates whether direct sunlight is blocked by leaves overhead (0 = yes, 1 = no) (parameter #5),

I s = solar irradiance at 90° elevation,

T = leaf transmittance,

p l = proportion of the sky occluded by leaves overhead (parameter #6), and

p s = occlusion of the sun by clouds (0 = full occlusion, 1 = no occlusion) (parameter #7).

The radiance per steradian due to diffuse reflectance coming off of the leaf’s upper surface was calculated as:

$$L_{{\mathrm{u}},{\mathrm{d}}}\left( \lambda \right) = I_{{\mathrm{down}}}\left( \lambda \right)R_{\mathrm{u}}\left( \lambda \right){\mathrm{\pi }}^{ - 1}$$ (15)

where

R u = diffuse reflectance of the upper leaf surface.

The radiance per steradian due to diffuse transmittance coming off of the leaf’s lower surface was calculated as:

$$L_{\mathrm{t}}\left( \lambda \right) = I_{{\mathrm{down}}}\left( \lambda \right)T\left( \lambda \right){\mathrm{\pi }}^{ - 1}$$ (16)

Note that the I sun component of I down must be calculated separately for upper leaf surface diffuse reflectance and lower leaf surface transmittance, as the angle of the sun incident upon the leaf will differ in the two cases.

The radiance per steradian due to diffuse reflectance coming off of the leaf’s lower surface was determined by first calculating upwelling irradiance as the product of downwelling irradiance and the reflectance of objects (leaves and leaf litter) below the leaf:

$$I_{{\mathrm{up}}}\left( \lambda \right) = \left( {I_{{\mathrm{sky}}}\left( \lambda \right) + I_{{\mathrm{cld}}}\left( \lambda \right) + \left( {1 - p_{\mathrm{l}}} \right)p_{\mathrm{s}}I_{\mathrm{s}}\left( \lambda \right)\cos {\theta _{\mathrm{z}}} + I_{\mathrm{t}}\left( \lambda \right)} \right)\\ \left( {p_{\mathrm{g}}R_{\mathrm{g}}\left( \lambda \right) + (1 - p_{\mathrm{g}})R_{\mathrm{u}}\left( \lambda \right)} \right)$$ (17)

where

p g = proportion of the ground visible through underlying vegetation (parameter #8), and

R g = reflectance of the leaf litter.

This upwelling irradiance was then used to calculate diffuse reflectance coming off of the lower leaf surface:

$$L_{{\mathrm{l}},{\mathrm{d}}}\left( \lambda \right) = I_{{\mathrm{up}}}\left( \lambda \right)R_{\mathrm{l}}\left( \lambda \right){\mathrm{\pi }}^{ - 1}$$ (18)

where

R l = reflectance of the lower leaf surface.

To calculate spectral radiance coming off of leaves due to specular reflections, we followed the Fresnel equations30. We used a conservative correction factor K of 1 for both upper and lower surfaces; Brakke (1994)31 found that leaf K can range from 0.6 to 3.5, and that sometimes the upper surface has a greater K than the lower surface, and sometimes vice versa. The conclusions drawn from our model were the same regardless of where we set K for the upper and lower leaf surfaces within the 0.6–3.5 range. The horizontally R s and vertically R p polarized components of reflectance were calculated as:

$$R_{\mathrm{s}} = K\left( {\frac{{n_1\cos \theta _{\mathrm{l}} - n_2\sqrt {1 - \left( {\frac{{n_1}}{{n_2}}\sin \theta _{\mathrm{l}}} \right)^2} }}{{n_1\cos \theta _{\mathrm{l}} + n_2\sqrt {1 - \left( {\frac{{n_1}}{{n_2}}\sin \theta _{\mathrm{l}}} \right)^2} }}} \right)^2$$ (19)

$$R_{\mathrm{p}} = K\left( {\frac{{n_1\sqrt {1 - \left( {\frac{{n_1}}{{n_2}}\sin \theta _{\mathrm{l}}} \right)^2} - n_2\cos \theta _{\mathrm{l}}}}{{n_1\sqrt {1 - \left( {\frac{{n_1}}{{n_2}}\sin \theta _{\mathrm{l}}} \right)^2} + n_2\cos \theta _{\mathrm{l}}}}} \right)^2$$ (20)

The refractive index of air32, n 1 , was set to 1. The refractive index of leaves33, n 2 , was set to 1.45. Leaf refractive index was approximated as constant with wavelength as there are no published measurements or models below 400 nm. n 2 may increase sharply close to 300 nm due to absorption by the leaf cuticle34; however, we found that setting refractive index to increase linearly from 1.45 to the highest recorded value in any natural material (4.14 at 1800 nm in Germanium)35 from 350 to 300 nm, or from 400 to 300 nm, had no major effects on our model’s output. In each model iteration, the specular light sources above and below (parameters #9 and #10) were extended light sources that were chosen randomly with a probability defined by the relative proportions of different objects in the habitat. If, for example, the specular light source from above was randomly selected to be overlying leaves, then the radiance of the specular light source per steradian would be calculated as:

$$L_{{\mathrm{sls}},{\mathrm{above}}}\left( \lambda \right) = I_{\mathrm{t}}\left( \lambda \right)(p_{\mathrm{l}}{\mathrm{\pi }})^{ - 1}$$ (21)

and the radiance per steradian of light specularly reflecting off the leaf’s upper surface would be calculated as:

$$L_{{\mathrm{u}},{\mathrm{s}}}\left( \lambda \right) = 0.5\left( {R_{\mathrm{s}} + R_{\mathrm{p}}} \right)L_{{\mathrm{sls}},{\mathrm{above}}}\left( \lambda \right)$$ (22)

The specular light source from below (i.e., light diffusely reflected from leaves or leaf litter) was randomly selected in a similar fashion. The radiance of this light source was calculated with the directness of sunlight (d r ) on the upwelling reflective surface as a randomized parameter (0 or 1) (parameter #11), according to the proportion of the sky occluded by clouds or leaves. If, for example, leaf litter was selected as the specular light source, then the radiance of this specular light source per steradian would be calculated as:

$$L_{{\mathrm{sls}},{\mathrm{below}}}\left( \lambda \right) = \left( {I_{{\mathrm{sky}}}\left( \lambda \right) + I_{{\mathrm{cld}}}\left( \lambda \right) + I_{\mathrm{t}}\left( \lambda \right) + d_{\mathrm{r}}p_{\mathrm{s}}I_{\mathrm{s}}\left( \lambda \right)\cos \theta _{\mathrm{z}}} \right)R_{\mathrm{g}}\left( \lambda \right){\mathrm{\pi }}^{ - 1}$$ (23)

and the spectral radiance per steradian of light specularly reflecting from the leaf’s lower surface would be calculated as:

$$L_{{\mathrm{l}},{\mathrm{s}}}\left( \lambda \right) = 0.5\left( {R_{\mathrm{s}} + R_{\mathrm{p}}} \right)L_{{\mathrm{sls}},{\mathrm{below}}}\left( \lambda \right)$$ (24)

The quantum catches of cone class i from the upper and lower leaf surfaces, respectively, were calculated as:

$$Q_{i,{\mathrm{u}}} = {\int } S_i\left( \lambda \right)T_{{\mathrm{m}},i}\left( \lambda \right)\left( {L_{{\mathrm{u}},{\mathrm{d}}}\left( \lambda \right) + L_{{\mathrm{u}},{\mathrm{s}}}\left( \lambda \right)} \right)d\lambda$$ (25)

$$Q_{i,{\mathrm{l}}} = {\int} {S_i\left( \lambda \right)T_{{\mathrm{m}},i}\left( \lambda \right)\left( {L_{{\mathrm{l}},{\mathrm{d}}}\left( \lambda \right) + L_{\mathrm{t}}\left( \lambda \right) + L_{{\mathrm{l}},{\mathrm{s}}}\left( \lambda \right)} \right)d\lambda }$$ (26)

where

S i = spectral sensitivity of cone class i,

T m,i = transmittance spectrum of optical media (cornea, lens, vitreous) associated with cone class i.

These last two parameters were the same as those used to design the custom filters for the Spectrocam (see “Camera Filter Design” above). Note that U- and V-cones have transparent oil droplets, so the oil droplet transmittance spectrum has been omitted here. Michelson10 achromatic contrast between upper and lower leaf surfaces was calculated as:

$$C_i = \frac{{Q_{i,{\mathrm{u}}} - Q_{i,{\mathrm{l}}}}}{{Q_{i,{\mathrm{u}}} + Q_{i,{\mathrm{l}}}}}$$ (27)

Finally, the relative performance of the V-cone was calculated as the difference in contrast seen by the V- (C V ) and U- (C U ) cones:

$$R = C_{\mathrm{V}} - C_{\mathrm{U}}$$ (28)

R > 0 indicates that the V-cone would see higher leaf-contrast, R < 0 indicates that the U-cone would see higher leaf-contrast, and R = 0 indicates that the V- and U-cones would see equal leaf-contrast.

Code availability

The MATLAB code used to execute the analyses is available from the corresponding author upon request.

Reporting summary

Further information on experimental design is available in the Nature Research Reporting Summary linked to this article.