Open Access
How to translate text using browser tools
3 July 2020 Quantifying colour difference in animals with variable patterning
Tereza Dračková, Radovan Smolinský, Zuzana Hiadlovská, Matej Dolinay, Natália Martínková
Author Affiliations +

Colour pattern influences behaviour and affects survival of organisms through perception of light reflectance. Spectrophotometric methods used to study colour optimise precision and accuracy of reflectance across wavelengths, while multiband photographs are generally used to assess the complexity of colour patterns. Using standardised photographs of sand lizards (Lacerta agilis), we compare how colours characterised using point measurements (using the photographs, but simulating spectrophotometry) on the skin differ from colours estimated by clustering pixels in the photograph of the lizard's body. By taking photographs in the laboratory and in the field, the experimental design included two 2-way comparisons. We compare point vs. colour clustering characterisation and influence of illumination in the laboratory and in the field. We found that point measurements adequately represented the dominant colour of the lizard. Where colour patterning influenced measurement geometry, image analysis outperformed point measurement with respect to stability between technical replicates on the same animal. The greater colour variation derived from point measurements increased further under controlled laboratory illumination. Both methods revealed lateral colour asymmetry in sand lizards, i.e. that colours subtly differed between left and right flank. We conclude that studies assessing the impact of colour on animal ecology and behaviour should utilise hyperspectral imaging, followed by image analysis that encompasses the whole colour pattern.


Organisms differ in their ability to recognise and perceive light of different wavelengths, specifically through the triggering of signal protein expression in the photoreceptor cells (Testylier & Gourmelon 1987). Entwined with the capacity to percept, colouration of animals has evolved immense variability. Studies focusing on light reflectance typically use spectrophotometric analysis. To calibrate the spectrophotometer, measurements of a standard and sample need to be set to within a millimetre of their relative positions, and to within a degree of the angle between the light source and the detector (Johnsen 2016). Despite being referred to as a point measurement, spectrophotometry samples a 2-dimensional circular area of illumination and reflectance. The precise geometry of the spectrophotometry measurement poses significant technical difficulties as standards, unlike live animals, are usually flat, while animals tend to resist immobilisation, not least by breathing. In relation to these technical constraints, spectrophotometric analysis during ecological research is most successful when using skin derivatives that can be removed from the animal (e.g. feathers, scales) or flat appendages (e.g. insect wings, fish fins) (McCoy & Prum 2019). In comparison, spectrophotometry is challenging on live animals or on objects with informative colour patterns and, as such, colour pattern complexity has been understudied (but see Maia et al. 2019, Šulc et al. 2019). This knowledge gap, together with recent development in digital photography and analytical power of software tools, has encouraged us to look for possible solutions that could circumvent the above described obstacles.

In this study, we set out to examine colour variation in sand lizards (Lacerta agilis, Reptilia: Lacertidae; Fig. 1). Sand lizards are relatively small (total length up to 240 mm), sexually dimorphic and with sympatric colour forms found across the Palearctic (Bischoff 1988, Font & Pérez i de Lanuza 2007, Andres et al. 2014). These colour forms differ both in predominant colour and in the position and number of stripes and spots on the animal's body (Kotenko & Sviridenko 2010). In addition to colour variation and sexual dimorphism, sand lizard colour changes with the seasons. Spots contributing to the colour pattern enlarge during the reproduction season (spring and early summer), and males are brightly coloured in the spring and become duller as the seasons progress. Depending on colour form, males may display hues of green and/or brown during the mating season, while females and juveniles display hues of brown throughout the year. For example, in the colour form “typica”, males have bright green flanks with dark brown spots that decrease in size dorsoventrally and large spots might have light green centres (Fig. 1). Dorsally, “typica” males have two light brown lines laterally with one line with dark brown spots located between them. The colour form “erythronota” has flanks as those described for the colour form “typica”, but their back is rusty brown and lacks colour pattern (Kotenko & Sviridenko 2010).

Fig. 1.

Sand lizard (Lacerta agilis) colouration shows variation both in colour and colour pattern. Female (left) and male (right) nuptial colouration. Size not to scale (photo R. Smolinský).


Due to the expected difficulties of spectrophotometry on small, living animals with complex colour patterns, we expected serious difficulties in undertaking spectrophotometry on sand lizards. We decided to quantify how the sand lizard colour and colour pattern influence the respective data obtained from point measurements. To do so, we compare two alternative methods for quantifying colour differences from standardised photographs. The first approach, hereafter referred to as a point measurement, simulates the measurements of a small area detected by a spectrophotometer. We take colour measurements at predefined body regions, regardless of any specific colour pattern. The second approach, referred to as a colour clustering measurement, assesses a complete photograph and sorts individual pixels by colour, irrespective of the colour pattern. In addition, we compare two alternative lighting conditions, i.e. fluorescent darkroom bulbs vs. natural environmental light, in order to evaluate the stability of the colours estimated. Our overall aim was to estimate the degree to which colour pattern influences accuracy of colour measurement. We addressed the aim through answering the following questions. 1) How do point and colour clustering approaches perform in estimating colour on photographs of animals with complex colour patterns? 2) What are the differences between measurements on photographs taken under controlled laboratory lighting vs. natural light influenced by sun position and weather? 3) Which method is more suitable for research of colouration of living, colourful animals in the wild?

Material and Methods


We sampled two different sand lizard populations during the months when the animals were active. The first population was from an orchard in Unín (48.72 N, 17.24 E) in Slovakia between April and September 2007 and the second from an orchard in Hustopeče (48.93 N, 16.72 E) in the Czech Republic between May and August 2018. Both localities were screened before and after the collection periods, allowing us to reliably confirm the first and last days when active animals were observed. All lizards were caught by hand or by noosing at weekly intervals and each was individually marked by toe clipping (Waichman 1992).

It is known that colour representation by reflected light depends strongly on illumination and the physical characteristics of the receivers, i.e. their respective physiology (Wyszecki & Stiles 2000, Barnard & Funt 2002, Hill & McGraw 2006). To reduce the influence of illumination, we used a photographic grey card (18% JJC neutral card) as a standard background in all photographs in order to minimise differences in lighting and camera setups. Lizards caught in 2007 were transported to the laboratory, where they were photographed in a darkroom using standardised light conditions and released the next day. Images were obtained using an Olympus UZ500 camera placed on a tripod over a standard photographic grey card with a scale and marking plate. Four white fluorescent lamps (OSRAM T5, 4000K) placed at cardinal points were used in order to avoid shadows. Four photographs were taken of each lizard (dorsal, ventral and both lateral sides), the lizard being released without immobilisation in front of the camera and recovered between each photograph. Before each photograph, the camera was set to white balance and the resultant images were saved in TIFF format. In 2018, all lizards caught were photographed on site using a Canon EOS400D camera with Canon EF28-90mm lens on a tripod, then immediately released. In this case, the lizards were hand-held on the photographic grey card with a scale and marking plate. The camera was located in shadow under vegetation in order to minimise discomfort for animals, and to decrease the effects of differing outdoor lighting conditions. Before photographing, the camera was set to white balance and the resultant images were saved in RAW format. These two approaches (i.e. photography under standardised laboratory lighting and photography outside in shadow) allowed us to compare the influence of lighting on the stability of colour measurements from the photographs. For the purposes of this study, we use photographs of both lateral sides of the lizards.

To estimate the age of individual animals, we used tpsDig v.2.02 (Rohlf 2005) software to measure body length from rostrum to anus (Lc) from the digital images. Lizards over 6 cm were considered adults, individuals of 4.7 to 6 cm were considered sub-adults that had over-wintered once but had not yet reproduced and those smaller than 4.7 cm were considered juveniles that had hatched in the given season (adjusted from Bischoff 1984).

Image analysis

To standardise photographs with respect to the different lighting conditions, we linearly transformed the colours on the photographs. We used an average of the colour channels measurements from 10 random pixels located on the grey card to estimate the direction and scale of the transformation, knowing that the RGB of the grey card should be 118, 118, 118 (Stevens et al. 2007, Thornbush 2008). We then cropped the standardised images to a rectangle between the front and hind legs of the lizards and transformed the RGB colour space to CIELAB using D65 reference white. The CIELAB colour space enhances perceptive differences between colours and enables representation of infinite number of possible colours in three-dimensional real number space. The images were then saved in lossless TIFF format.

We selected three pixels on the cropped images where colour was to be measured. The pixels were dorsoventrally equidistant and spaced at 20, 50 and 80% of the image width in a craniocaudal direction (Fig. 2). These were the centres, from which we enlarged the area centred at each pixel to 9 × 9 pixels for 81 technical replicates of each measurement per image. The pixels for technical replicates were utilised in two alternative ways. First, we evaluated the point measurements of the colour of sand lizards by calculating the average of 5 × 5 pixels centred on each technical replicate pixel for each colour channel. By enlarging the area of the point measurement to 5 × 5 pixels, we simulate the situation where a spectrophotometer would measure colour on the surface of about 2 mm2. For the colour clustering method, we used the equidistant pixels in the cranial, central and caudal regions in the 81 technical replicates as starting points for k-means clustering (i.e. k = 3). We added a random jitter ≈10–6 to each colour channel at the starting points for numerical stability of the k-means clustering algorithm.

Fig. 2.

Colour assessment scheme for point measurements and starting points for colour clustering measurement. We selected three regions on the lizard's body located equidistant laterally and at 20, 50 and 80% of the image width craniocaudally. For the point measurements, we averaged colours across the three regions, taking an area of 5 × 5 pixels in each region (dashed lines). For colour clustering, we used the colours of the three pixels, one from each squared region, as starting points for the k-means clustering algorithm. We then repeated the analysis with a sliding window approach spaced one pixel across a 9 × 9 area for each individual (solid lines), obtaining 81 technical replicates per photograph. These were used to assess the stability of the colour estimated using the given approach.


Statistical analysis

For each image, we calculated the mean and standard deviation of the mean (SD) for each colour channel. This was done for all point measurement replicates and in the case of the colour clustering method, for the cluster centroids ordered by luminance. We then compared the colour means obtained for each channel under the two lighting schemes using the t-test, correcting the significance for multiple comparisons with the false discovery rate (FDR).

We compared the colours estimated from the point measurements to colours from the colour clustering using ΔE00 colour difference. The ΔE00 distance is the Euclidean distance between two colours in the CIELAB colour space, corrected for perceptive differences (Hunt 2004). All analyses were run in the R statistical platform (R Core Team 2019) using custom scripts based on the packages EBImage (Pau et al. 2010), imager (Barthelmé 2019), RColorBrewer (Neuwirth 2014), scatterplot3d (Ligges & Mächler 2003), spacesXYZ (Davis 2018), stringr (Wickham 2018) and tiff (Urbanek 2013).

Ethics statement

Sampling was based on permits 2579/2007-2.1 and 1323/527/05-5.1, issued by The Ministry of the Environment of the Slovak Republic, and JMK38000/2018, issued by the Regional Authority of the South Moravian Region, Brno. Animal handling complied with Czech Law No. 114/1992 on Nature and Landscape Protection. The authors were authorised to handle wild lizards according to the Certificate of Professional Competence (Nos. CZ01287andCZ03799;§15d,ActNo.246/1992Coll.).


During the 2007 season, 167 lizards were caught, including 159 adults (79♂, 80♀) and 8 subadults (4♂, 4♀), 36 of which were recaptured. No juveniles were caught in 2007. In 2018, we caught 80 lizards, including 58 adults (21♂and 37♀), 4 subadults (2♀, 2 no sex identified) and 18 juveniles (no sex identified), 19 of which were recaptures. There was no significant difference in body size between sites, with adults measuring ♂Lc ∈ [60,85] mm, ♀Lc ∈[60,87] mm and subadults ♂Lc ∈ [47,48] mm, ♀Lc ∈ [49,56] mm.

Fig. 3.

Colour measurement variation along the flanks of sand lizards. A) Standard deviation (SD) of colour channels in CIELAB colour space for colour means of sand lizards. Using three regions on the cropped image of a sand lizard, we averaged the colour for the point measurements and used the colours in each region as starting values for three clusters in the colour clustering algorithm. Clusters 1-3 were ordered by increasing luminance. B) SD of colour channels differentiated according to photographic lighting. The statistical significance of differences in lighting was evaluated with a t-test and corrected for multiple comparisons with false discovery rate. C) ΔE00 colour difference between colour means estimated from the left and right flank of each animal. D) ΔE00 colour difference between colour means estimated from the point measurements and each of the three colour clusters from colour clustering. SD – standard deviation of the mean, L – luminance, a – green to red, b – blue to yellow, *** – p < 0.001.


As a result of the lizards not being immobilised during photography in 2007, photographs of 34 lizards had to be removed from the study as body position prevented the images from being cropped to the designated rectangle. No individuals photographed in 2018 were discarded.

When using the point measurements, the mean colour of each lizard photograph had a greater SD than the mean colour of cluster centroids from the colour clustering approach (Fig. 3A). This means that point approach measured different colours when the geometry of the measurement changed.

We found no difference in colour variation between the laboratory and natural lighting schemes when estimating colours with colour clustering. The SD of colour channel means from the point measurements in photographs taken under natural light and standardised to a grey card were significantly lower than those taken under controlled illumination in the laboratory (t-test: p < 0.05, Fig. 3B). The comparison of colour channel identity trends between the point and colour clustering measurements shows similar patterns under laboratory and natural lighting for all colour channels (Fig. 4).

Next, we were interested in whether colours differed on the two flanks of the lizard. Using point measurements, colour difference between paired sides of the same lizard was ΔE00 ≈ 7.4 (Fig. 3C). In comparison, the colour difference between each colour clustering cluster from the left and right side of each animal was significantly lower than that using the point measurements (ΔE00 ≈ 3.9, t-test: p < 0.05). The mean colour difference between point measurements and cluster 2 from colour clustering was lowest with ΔE00 ≈ 4.9 (Fig. 3D) while the mean difference between clusters 1 and 3 was greater than 20. Cluster 2, as ordered by luminance of the cluster centroids, was the cluster to which most pixels were usually allocated (mean: 41.28%, range ∈ [23.3,65.0]%). The ΔE00 distance between colour from the point measurement and the colour of the most frequent cluster from colour clustering decreased with increasing frequency of the colour (linear model: β0 = 29.6, β1 = –47.1; F1,491 = 55.7, p < 0.001).

Fig. 4.

Comparison of colour channel identity between point and colour clustering measurements of colour in sand lizards under laboratory and natural lighting. Dotted line – colour channel shows identical measurement between the two approaches, red line – comparison to cluster 1, blue line – cluster 2, green line – cluster 3. L – luminance, a – green to red, b – blue to yellow.



In animals with a complex colour pattern, such as spots and stripes on sand lizards, point measurements cannot consistently capture colour because of the spatial distribution of the colour pattern. Our data showed that colours estimated from colour clustering displayed lower variation in the resulting predominant colours than averaging across multiple pixels at a point measurement (Fig. 3A). The colour clustering of all pixels in the standardized image extracted the predominant colours displayed on the photographed animal, irrespective of the colour pattern. Point measurements of the reflectance spectra, here reduced to the red, green and blue channels, necessitates averaging across an area of 1-2 mm2, or across multiple pixels. The average did not correspond to the colour observed on the individual when the measured area included partial colour pattern similarly as was observed in another lizard, Zootoca vivipara (Martin et al. 2013). To reduce such variability in the point measurements, and to increase reproducibility of the measurement, one must choose between consistency in selecting morphologically homologous areas on the body and consistency in the colours measured with respect to the colour pattern. The user must then select pixels of the intended colour, thereby bringing subjectivity into the data acquisition.

One might ask what a point measurement of colour actually estimates in animals with a colour pattern. Intuitively, one would expect that either a colour from a point measurement represents the mean of colours contributing to the colour pattern or that it reflects the most frequent colour present on the animal. We averaged the colours across 25 pixels large area in the point approach and we observed that the difference between the point and colour clustering measurement decreased as the cluster size increased. This means that the point measurements reflected the most frequent colour present on the animal.

Lighting influences photography, and to avoid variation, controlled lighting in a laboratory has been recommended (Stevens et al. 2007). We found that standardising photographs allows reliable field research. There was no difference in variation in colour estimated from colour clustering and less variation in colour from point measurements from photographs taken under natural light (Fig. 3B). Our experimental design did not allow direct comparison between the lighting conditions, but, indirectly, the colour channels showed similar trends in identity between point and colour clustering measurements of colour from photographs taken under laboratory and natural lighting for all colour channels (Fig. 4). This indicates that following standardisation, photography in the field using natural lighting provides stable results suitable for statistical analysis of life animal colouration.

Colour pattern symmetry has been proposed as an honest signal reflecting the fitness of an individual. Colour asymmetry observed herein (Fig. 3C) would be expected in animals with colour patterns that differ laterally (Swaddle & Cuthill 1994). Lateral variation in colour pattern influenced point measurements of colour considerably. Larger differences in colour from point measurements of the two flanks of sand lizards and small differences in colours from colour clustering measurements of the flanks indicate that asymmetry in colour pattern is more pronounced than asymmetry in individual colours displayed on each flank of an animal. Although research on reptile colour laterality is sparse (Laia et al. 2015), the colour pattern asymmetry might be linked to lateralised display (Shedd 2009) or sun basking (Martín et al.1995).

Measuring colour in animals bearing complex colour patterns is challenging. Errors associated with point measurement rise along with increasing complexity of the colour pattern, contributing to the many disadvantages of spectrophotometry (c.f. Johnsen 2016). While point measurements taken either by spectrophotometry or by the here presented point approach, might be appropriate for animals with large patches of similar colour, such as the green lizard (Lacerta viridis). For others, we recommend a method of colour analysis that directly considers colour pattern. Ideally, one would combine depth of information from reflectance spectra (point measurement with spectrophotometry or hyperspectral imaging (McCoy et al. 2019, Tedore & Nilsson 2019)) with clustering of similar colours (colour clustering) to provide detailed information on the animal's colour pattern, reflecting its full splendour.


We thank Adam Konečný for allowing us access to his orchard, and Zuzana Dolinay, Markéta Harazim, Pavol Hiadlovský and Alexandra Zahradníková jr. for help with field work. Access to computing and storage facilities owned by parties and projects contributing to the National Grid Infrastructure MetaCentrum, provided under the programme “Projects of Large Research, Development, and Innovation Infrastructures” (CESNET LM2015042), is greatly appreciated. This study was supported by the Institute of Vertebrate Biology of the Czech Academy of Sciences (Grant No. 900623). Author contributions: T. Dračková, R. Smolinský, Z. Hiadlovská and N. Martínková conceptualised the study; T. Dračková, R. Smolinský, Z. Hiadlovská and M. Dolinay and N. Martínková collected material; T. Dračková, R. Smolinský, M. Dolinay and N. Martínková analysed the data; T. Dračková, R. Smolinský and N. Martínková wrote the manuscript, which all authors reviewed.



Andres C., Franke F., Bleidorn C. et al. 2014: Phylogenetic analysis of the Lacerta agilis subspecies complex. Syst. Biodivers. 12: 43–54. Google Scholar


Barnard K. & Funt B. 2002: Camera characterization for color research. Color Res. Appl. 27: 152–163. Google Scholar


Barthelmé S. 2019: imager: image processing library based on'CImg', R package version 0.41.2. Google Scholar


Bischoff W. 1984: Lacerta agilis Linnaeus 1758 – Zauneidechse. In: Bohme W. (ed.), Handbuch der Reptilien und Amphibien Europas, Band 2/1 Echsen II (Lacerta). Aula Verlag , Wiesbaden . Google Scholar


Bischoff W. 1988: Zur Verbreitung und Systematik der Zauneidechse, Lacerta agilis Linnaeus, 1758. Mertensiella 1: 11–30. Google Scholar


Davis G. 2018: spacesXYZ: CIE XYZ and some of its derived color spaces. R package version 1.0-4 Google Scholar


Font E. & Pérez i de Lanuza G. 2007: Ultraviolet reflectance of male nuptial colouration in sand lizards (Lacerta agilis) from the Pyrenees. Amphib.-Reptil. 28: 438–443. Google Scholar


Hill G.E. & McGraw K.J. 2006: Bird coloration, 1st ed. Harvard University Press , Cambridge, MA . Google Scholar


Hunt R.W.G. 2004: The reproduction of colour, 6th ed. John Wiley & Sons, Ltd , Chichester, UK . Google Scholar


Johnsen S. 2016: How to measure color using spectrometers and calibrated photographs. J. Exp. Biol. 219: 772–778. Google Scholar


Kotenko T.I. & Sviridenko Y.Y. 2010: Variability of coloration and pattern of the sand lizard, Lacerta agilis (Reptilia, Sauria, Lacertidae): methodic aspects. Vestn. Zool. 44: 137–162. ( in Russian ) Google Scholar


Laia R.C., Pinto M.P., Menezes V.A. & Rocha C.F.D. 2015: Asymmetry in reptiles: what do we know so far? Springer Sci. Rev. 3: 13–26. Google Scholar


Ligges U. & Mächler M. 2003: scatterplot3d – an R package for visualizing multivariate data. J. Stat. Softw. 8: 1–20. Google Scholar


Maia R., Gruson H., Endler J.A. & White T.E. 2019: Pavo 2: new tools for the spectral and spatial analysis of colour in R. Methods Ecol. Evol. 10: 1097–1107. Google Scholar


Martín J., López P., Carrascal L.M. & Salvador A. 1995: Adjustment of basking postures in the high-altitude Iberian rock lizard (Lacerta monticola). Can. J. Zool. 73: 1065–1068. Google Scholar


Martin M., Meylan S., Gomez D. & Le Galliard J.-F. 2013: Ultraviolet and carotenoid-based coloration in the viviparous lizard Zootoca vivipara (Squamata: Lacertidae) in relation to age, sex, and morphology. Biol. J. Linn. Soc. 110: 128–141. Google Scholar


McCoy D.E., McCoy V.E., Mandsberg N.K. et al. 2019: Structurally assisted super black in colourful peacock spiders. Proc. R. Soc. Lond. B 286: 20190589. Google Scholar


McCoy D.E. & Prum R.O. 2019: Convergent evolution of super black plumage near bright color in 15 bird families. J. Exp. Biol. 222: Google Scholar


Neuwirth E. 2014: RColorBrewer: ColorBrewer palettes, R package version 1.1-2. Google Scholar


Pau G., Fuchs F., Sklyar O. et al. 2010: EBImage: an R package for image processing with applications to cellular phenotypes. Bioinformatics 26: 979–981. Google Scholar


R Core Team 2019: R: a language and environment for statistical computing. R Foundation for Statistical Computing , Vienna, Austria . Google Scholar


Rohlf F. 2005: tpsDig, digitize landmarks and outlines, version 2.05. Accessed 21 Sept 2012. Google Scholar


Shedd J.D. 2009: Bilateral asymmetry in two secondary sexual characters in the western fence lizard (Sceloporus occidentalis): implications for a correlation with lateralized aggression. MSc thesis, California State University , Chico, CA, USA . Google Scholar


Stevens M., Párraga C.A., Cuthill I.C. et al. 2007: Using digital photography to study animal coloration. Biol. J. Linn. Soc. 90: 211–237. Google Scholar


Swaddle J. & Cuthill I. 1994: Preference for symmetric males by female zebrafinches. Nature 367: 165–166. Google Scholar


Šulc M., Troscianko J., Štětková G. et al. 2019: Mimicry cannot explain rejection type in a host-brood parasite system. Anim. Behav. 155: 111–118. Google Scholar


Tedore C. & Nilsson D. 2019: Avian UV vision enhances leaf surface contrasts in forest environments. Nat. Commun. 10: 238. Google Scholar


Testylier G. & Gourmelon P. 1987: Spectrophotometry in vivo, a technique for local and direct enzymatic assays: application to brain acetyl-cholinesterase. Proc. Natl. Acad. Sci. U. S. A. 84: 8145–8149. Google Scholar


Thornbush M.J. 2008: Grayscale calibration of outdoor photographic surveys of historical stone walls in Oxford, England. Color Res. Appl. 33: 61–67. Google Scholar


Urbanek S. 2013: tiff: read and write TIFF images. package version 0.1-5 Google Scholar


Waichman A. 1992: An alphanumeric code for toe clipping amphibians and reptiles. Herpetol. Rev. 23: 19–21. Google Scholar


Wickham H. 2018: stringr: simple, consistent wrappers for common string operations. Google Scholar


Wyszecki G. & Stiles W.S. 2000: Color science: concepts and methods, quantitative data, and formulae. John Wiley & Sons , New York . Google Scholar
Tereza Dračková, Radovan Smolinský, Zuzana Hiadlovská, Matej Dolinay, and Natália Martínková "Quantifying colour difference in animals with variable patterning," Journal of Vertebrate Biology 69(4), 20029.1-9, (3 July 2020).
Received: 25 March 2020; Accepted: 18 May 2020; Published: 3 July 2020
colour pattern
image analysis
Back to Top