The CaliPhoto Method

We propose an innovative method based on photography and image processing of interdisciplinary relevance, permitting the uncomplicated and inexpensive evaluation of material properties. This method—CaliPhoto—consists of using a dedicated colour plate with a specific design, placed in the field of view of a photograph of the material to be characterized. A specific image processing workflow is then applied to obtain colour vectors independent of illumination conditions. The method works using commercial colour cameras (e.g., smartphone cameras), and the colour plate can be printed on any colour printer. Herein, we describe the principle of the method and demonstrate that it can be used to describe and compare samples, identify materials or make relatively precise concentration measurements. The CaliPhoto method is highly complementary to any scientific research and may find applications across a range of domains, from planetary science to oceanography. The method may also be widely used in industry.


Introduction
Colour is the primary parameter used in many domains to identify and characterize a material. It is used for quality control in such industries as food [1], building [2,3] or textiles [4], amongst others. For scientific purposes, colour observation is a rapid method to estimate the composition of a material, as in the geosciences (Munsell soil colour charts [5]) or in biology (e.g., dermatology [6]), to monitor changes in physical properties (e.g., rock ageing [7,8]), or to obtain specific physical properties (e.g., temperature or pH). Nevertheless, the apparent colour of material is directly dependant on light conditions and photon detectors; the human eye is limited and person-dependant (e.g., colour blindness), and camera detectors have different colour responses. Precise colour measurement is thus Since they cover a wide and relevant range of colours, the RGB values of the colour squares of the CaliPhoto colour plate used in this study are similar to those of the GretagMacBeth ColorChecker typically used for colour calibration ( Figure 1) [9,10]. It is expensive and, moreover, quite impossible to print a colour plate with the exact theoretical colour values displayed in Figure 1. Nevertheless, contrary to colorimetry methods, the aim of the CaliPhoto method is not to obtain true colours, as for calibrating a camera or a printer, nor to obtain colours representative of human vision. The CaliPhoto colour plate ( Figure A1) can thus be printed using any commercial printer and paper. The size of the colour plate, ranging from a few cm to several tens of cm, is chosen according to the material of interest and the imaging system used (see Appendix A for details). Note that the colour palette used in Figure 1 has been chosen only as an example and can be changed to be more relevant to the colour chart of the studied materials. Similarly, their number can be increased or decreased if required (and the code given in Supplementary Materials will need to be modified accordingly).

Make a Reference Image of the Printed CaliPhoto Colour Plate.
The processing required to obtain the reference image of the colour plate is explained in Figure  2. Since the colour plate has been printed using a noncalibrated printer, it is necessary to make a reference image of that colour plate taking into accounts its specific colours. The CaliPhoto method requires neither high-quality colour printing nor a specific light source or camera. The reference image is obtained by simply acquiring a photograph of the printed colour plate (Figure 2a). The relatively unrestricted recommendations for the acquisition of this photograph are detailed in Appendix B. The image is then rescaled and resized in order to remove perspective distortion and to obtain an image with a width/height ratio similar to that of the numerical model (i.e., a 4:3 ratio rectangle without the logo band). The resolution of the images may also be fixed; here we used a resolution of 1200 pixels × 1020 pixels including the logo band ( Figure 2b). This can easily be made using image processing software, such as GIMP (see Appendix B, Figure A3 for details). Since it is difficult to control the orientation and homogeneity of the light source, the external and internal white rectangles of the colour plate (see Figure 1) are used to evaluate and correct the inhomogeneity of the illumination. This approach is inspired by the standard "plane fitting" data processing used in Scanning Probe Microscopy in order to remove the slope induced by the nonparallelism between the sample surface and the scanning plane (e.g., [11]). Indeed, in the absence of shadow, the light orientation will form a brightness continuum over the colour plate that can be fitted using a polynomial surface (see details in Appendix B, Figure A4). The equation of this plane can then be used in order to remove the illumination inhomogeneity over the whole image. In order to avoid values higher than 255, the average R, G and B values of the white rectangles are reset to 230 ( Figure  2c). The fourth step consists of setting the brightness and contrast of the image. This is done by using a polynomial regression of order 3, linking the R, G and B values measured on the previously corrected image to the theoretical values displayed in Figure 1 (Figure 2d). These two steps also compensate the chromaticity of the light source (i.e., after correction, R ≈ G ≈ B in the greyscale squares). After correction, the colours of the squares in the reference image (Figure 2d) are different from the theoretical values ( Figure 1).

Make a Reference Image of the Printed CaliPhoto Colour Plate
The processing required to obtain the reference image of the colour plate is explained in Figure 2. Since the colour plate has been printed using a noncalibrated printer, it is necessary to make a reference image of that colour plate taking into accounts its specific colours. The CaliPhoto method requires neither high-quality colour printing nor a specific light source or camera. The reference image is obtained by simply acquiring a photograph of the printed colour plate (Figure 2a). The relatively unrestricted recommendations for the acquisition of this photograph are detailed in Appendix B. The image is then rescaled and resized in order to remove perspective distortion and to obtain an image with a width/height ratio similar to that of the numerical model (i.e., a 4:3 ratio rectangle without the logo band). The resolution of the images may also be fixed; here we used a resolution of 1200 pixels × 1020 pixels including the logo band ( Figure 2b). This can easily be made using image processing software, such as GIMP (see Appendix B, Figure A3 for details). Since it is difficult to control the orientation and homogeneity of the light source, the external and internal white rectangles of the colour plate (see Figure 1) are used to evaluate and correct the inhomogeneity of the illumination. This approach is inspired by the standard "plane fitting" data processing used in Scanning Probe Microscopy in order to remove the slope induced by the nonparallelism between the sample surface and the scanning plane (e.g., [11]). Indeed, in the absence of shadow, the light orientation will form a brightness continuum over the colour plate that can be fitted using a polynomial surface (see details in Appendix B, Figure A4). The equation of this plane can then be used in order to remove the illumination inhomogeneity over the whole image. In order to avoid values higher than 255, the average R, G and B values of the white rectangles are reset to 230 (Figure 2c). The fourth step consists of setting the brightness and contrast of the image. This is done by using a polynomial regression of order 3, linking the R, G and B values measured on the previously corrected image to the theoretical values displayed in Figure 1 (Figure 2d). These two steps also compensate the chromaticity of the light source (i.e., after

Making Comparable Images of the Materials.
The aim of the CaliPhoto method is to compare different materials based on their colours when observed in different light conditions. The idea is thus to process the images of the materials using the colour plate in order to obtain images where all the colour squares have similar RGB values to those of the reference image ( Figure 2d). The image of a material is obtained by placing the sample below the window of the same printed colour plate as used previously. It is important that the colour plate is as close as possible to, and ideally in contact with, the surface of the material of interest. This is because the light conditions must be the same on both the colour plate and the sample. Image processing is then similar to that used in order to obtain the reference image of the colour plate ( Figure 2). Following this, a complementary step is applied to correct the colours of these new images, resetting the RGB values of the colour squares of the colour plate to those of the reference image using a polynomial transform similar to those explained in [6,12] (Figure 3). We have demonstrated that a polynomial regression of order 11 yields the best correction (see Appendix C).

Making Comparable Images of the Materials
The aim of the CaliPhoto method is to compare different materials based on their colours when observed in different light conditions. The idea is thus to process the images of the materials using the colour plate in order to obtain images where all the colour squares have similar RGB values to those of the reference image ( Figure 2d). The image of a material is obtained by placing the sample below the window of the same printed colour plate as used previously. It is important that the colour plate is as close as possible to, and ideally in contact with, the surface of the material of interest. This is because the light conditions must be the same on both the colour plate and the sample. Image processing is then similar to that used in order to obtain the reference image of the colour plate ( Figure 2). Following this, a complementary step is applied to correct the colours of these new images, resetting the RGB values of the colour squares of the colour plate to those of the reference image using a polynomial transform similar to those explained in [6,12] (Figure 3). We have demonstrated that a polynomial regression of order 11 yields the best correction (see Appendix C). After correction, the RGB values of the colour squares in the image of the sample must be similar to those on the reference image of the colour plate; however, the correction can never be perfect. The accuracy of the image processing has been tested under different illumination conditions, using different imaging systems and for different image resolutions (see Appendices C and D). In order to evaluate the colour correction of the images using the CaliPhoto method, the final RGB values of the colour squares on the final images of the samples are compared to those of the reference image of the colour plate using Δ, defined as: where The detailed results of the tests are reported in Appendices C and D; however, one can conclude that: • The best correction is obtained when the size of the colour plate in pixels on the image is close to that of the colour plate on the reference image before resizing. After correction, the RGB values of the colour squares in the image of the sample must be similar to those on the reference image of the colour plate; however, the correction can never be perfect. The accuracy of the image processing has been tested under different illumination conditions, using different imaging systems and for different image resolutions (see Appendices C and D). In order to evaluate the colour correction of the images using the CaliPhoto method, the final RGB values of the colour squares on the final images of the samples are compared to those of the reference image of the colour plate using ∆, defined as: • The best correction is obtained when the size of the colour plate in pixels on the image is close to that of the colour plate on the reference image before resizing.

•
The correction of an image with respect to the reference image remains good, even in low-light environments. It is shown that ∆ < 3% when the luminance µ = (R + G + B)/3 of the white square in the sample image is higher than approximately 100, and when the image dynamic (i.e., µ of white square minus µ of black square) is higher than approximately 100. • The "colour" of the light does not play a role in the final correction; for a difference of 54 between the highest and the lowest of the three RGB values of the white square, ∆ = 1%.

•
It is better to use the same camera throughout the whole procedure, even if ∆ < 2% when using different imaging devices.
Finally, the tests show that in "normal" conditions, the method allows the user to obtain a dataset of images in which the difference between the RGB values of colour squares in the colour plate (between two images) is always approximately ∆ ≈ 1%. In other words, this means that the percentage of uncertainty in the CaliPhoto colour of a material (i.e., its colour plate-dependent colour) is only about 1%.

Comparison of Materials from the Colours Given by CaliPhoto
For samples that are relatively homogeneous in colour, materials can be compared using their average CaliPhoto RGB values in the following equation: where R i , G i , B i and R j , G j , B j are the average CaliPhoto RGB values of the sample i and j respectively. Nevertheless, depending on the materials of interest, more complex vectors may be defined (see Appendix E). In particular, we propose to use the histograms of the rg chromaticity (r,g,b) and luminance (µ) parameters and to merge them into a unique colour vector Vec, which is defined for material i as: where Hist(r i ) corresponds to the histogram of r i , rounded to 0.05, over the sample area, [1 + Hist(g i )] to the histogram of g i , rounded to 0.05, displayed between 1 and 2, [2 + Hist(b i )] to the histogram of b i , rounded to 0.05, displayed between 2 and 3, and [1 + Hist(µ i /256)] to the histogram of µ i /256, rounded to 0.05, displayed between 3 and 4, and Max {r i , g i , b i , (µ i /256)} to the maximal values of the different histograms. This simple method allows the inhomogeneity of the colour of a material to be easily taken into account while avoiding complex textural image processing. Finally, for samples that are relatively homogeneous in colour, materials 1 and 2 can be compared based on their colour vector using the following equation:

Results
The CaliPhoto method permits the comparison of materials from images taken under different light conditions. The applications of this approach are thus very wide and numerous. For instance, in the field, it can be used to measure compositional variations across a rock outcrop or to compare the different sides of an object, from a hand sample to a geological structure or a building, where the shadows and illumination necessarily vary between the different snapshots (change of illumination conditions with time and space) ( Figure 4). In addition to allowing the comparison of different materials, this method is also relevant for monitoring physical processes associated with colour change, such as alteration or chemical reactions (oxidation, weathering, irradiation, water content, etc.).
Furthermore, by creating a database of CaliPhoto colour vectors (or RGB values) the method can be used to perform preliminary characterisation of an "unknown" material based on analyses of comparable materials using laboratory-based instrumentation. The philosophy is then to link properties obtained using expensive and/or nonportable instrumentation to measurements made by low-cost, highly portable imaging. The principle consists of characterising the materials expected to be found in the field, using laboratory instruments if needed, to make their CaliPhoto image following the process previously described, then to store their RGB CaliPhoto vectors in a database linking these vectors to the different materials or to any other relevant physical parameter(s). By comparison with the database, it would then be possible to identify or determine the physical properties of an unknown material using only a photograph. The method is resilient: a database can be made and completed at any time and, thus, the characterisation of "unknown" materials is continuously improved and refined with time. Figure 5 illustrates the use of the CaliPhoto method In addition to allowing the comparison of different materials, this method is also relevant for monitoring physical processes associated with colour change, such as alteration or chemical reactions (oxidation, weathering, irradiation, water content, etc.).
Furthermore, by creating a database of CaliPhoto colour vectors (or RGB values) the method can be used to perform preliminary characterisation of an "unknown" material based on analyses of comparable materials using laboratory-based instrumentation. The philosophy is then to link properties obtained using expensive and/or nonportable instrumentation to measurements made by low-cost, highly portable imaging. The principle consists of characterising the materials expected to be found in the field, using laboratory instruments if needed, to make their CaliPhoto image following the process previously described, then to store their RGB CaliPhoto vectors in a database linking these vectors to the different materials or to any other relevant physical parameter(s). By comparison with the database, it would then be possible to identify or determine the physical properties of an unknown material using only a photograph. The method is resilient: a database can be made and completed at any time and, thus, the characterisation of "unknown" materials is continuously improved and refined with time. Figure 5 illustrates the use of the CaliPhoto method for sample identification and for compositional measurement (detailed results can be found in Appendices E and F). for sample identification and for compositional measurement (detailed results can be found in Appendices E and F). Finally, the only restriction of the method is the fact that it is necessary to associate a database to a specific colour plate. If this colour plate were to be lost or altered, the database would become obsolete. We thus propose to maintain a Master Colour plate in a secure place so that the reference Finally, the only restriction of the method is the fact that it is necessary to associate a database to a specific colour plate. If this colour plate were to be lost or altered, the database would become obsolete. We thus propose to maintain a Master Colour plate in a secure place so that the reference image of a new colour plate can be recalibrated for use with a previously established database (see Appendix G).

Discussion
The rationale of the CaliPhoto method is not to provide extremely precise measurements, but to rapidly and easily give preliminary results using a very versatile and uncomplicated, low-cost, portable system. It permits the evaluation of properties that would normally need to be studied using expensive, time-consuming, high-tech methodologies or instrumentation. It can be used as a rapid monitoring and precharacterization method in the field or in the laboratory and it may, for instance, help in identifying the most appropriate samples for further in-depth analysis. The CaliPhoto method thus has applications in various domains: • Space exploration: As mentioned above, instrumentation used during in situ space exploration is generally limited for technical reasons (limited mass, volume, energy and computational power).
On the other hand, all space probes have on board a camera. Integrating a CaliPhoto colour plate with imaging systems on future space probes would be simple since it easily complies with the imposed technical limitations and does not require the development of new instrumentation. It could be particularly relevant for geological and astrobiological investigations, permitting the comparison of images of rocks taken in different places or evaluation of lithologies using images of rocks taken in the laboratory, for example.

•
Construction: The method may find different applications in this domain, for example, to check the homogeneity of materials over large areas or on the different faces of a structure, to monitor the ageing of materials over space and time, or to control the water content of cement. • Geology: As for space exploration, the method allows easy comparison of samples observed in different places in the field. When associated with a database, it can also facilitate the use of soil colour charts.

•
Biology: Colour is used as a parameter to pre-identify microbial colonies or to evaluate their reaction to external stresses (sunlight, dehydration, pH, salinity, etc.). This applies more generally for any living system (the yellowing of leaves, for example). The CaliPhoto may thus be used as a noninvasive and rapid method of monitoring such types of samples. • Materials science: Changes in the physico-chemical characteristics of materials may be associated with a change in colour. The possibility to monitor such changes during specific experiments may be particularly useful in determining reaction kinetics. Association with a database linking specific properties to CaliPhoto colours may circumvent or limit the systematic use of sophisticated instrumentation. It may help to refine measurements based on colour, such as those obtained using pH paper. • Submarine investigation: Underwater imaging is generally affected by water colour and inherently limited control of the light source. Submarine instrumentation is also limited compared with laboratory instrumentation. The CaliPhoto method may thus also be particularly useful in this setting. By linking physical properties obtained by laboratory analysis to a CaliPhoto database, it could be possible to estimate these properties from images made underwater, without sampling.

•
Cosmetics and dermatology: The CaliPhoto method may assist in the selection of makeup adapted to specific types of skin. It may also provide a control for Sun exposure to prevent sunburn. In the latter case, the idea would be to take pictures regularly of the same part of the body to monitor any change in colour.
Several studies on various applications of the CaliPhoto method are in progress in field geology and space exploration. In particular, the method will be adapted for the upcoming European Space Agency (ESA)/Roscosmos ExoMars 2020 mission to Mars to assist in the identification of rocks using the Close-Up Imager (CLUPI) camera [13].
While the CaliPhoto method has many applications for scientific purposes, it could also be used by the general public, for which an app for smartphones and tablets is under development. This implies automation of the method since manual image processing and MATLAB code cannot be used. Significant work has thus been carried out to integrate the automatic detection of the colour plate and of the sample area, and for automated comparison with databases. Finally, prototypes of apps and specific colour plates are currently under development for cosmetics, paints and decoration, for example, to identify complementary colours of textiles (N.B. in aesthetic cases, the matching percentage uses the Lab colour system to take into account the higher sensitivity of the human eye to green). The method could also be particularly relevant for assisting the colour-blind.
Finally, it is important to note that the CaliPhoto method is in line with the long-term vision for future developments in scientific technologies that favour low-cost solutions prior to methods that consume large amounts of resources. The philosophy of this approach is now echoed in many domains concerned by environmental considerations and future limitations in resources.

Patents
A patent has been deposited for this method under the number FR3042058 (A1).

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. Print the CaliPhoto Colour Plate
The ready-to-print version of the CaliPhoto colour plate is given in Figure A1. While the CaliPhoto method has many applications for scientific purposes, it could also be used by the general public, for which an app for smartphones and tablets is under development. This implies automation of the method since manual image processing and MATLAB code cannot be used. Significant work has thus been carried out to integrate the automatic detection of the colour plate and of the sample area, and for automated comparison with databases. Finally, prototypes of apps and specific colour plates are currently under development for cosmetics, paints and decoration, for example, to identify complementary colours of textiles (N.B. in aesthetic cases, the matching percentage uses the Lab colour system to take into account the higher sensitivity of the human eye to green). The method could also be particularly relevant for assisting the colour-blind.
Finally, it is important to note that the CaliPhoto method is in line with the long-term vision for future developments in scientific technologies that favour low-cost solutions prior to methods that consume large amounts of resources. The philosophy of this approach is now echoed in many domains concerned by environmental considerations and future limitations in resources.

Patents
A patent has been deposited for this method under the number FR3042058 (A1).

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A: Print the CaliPhoto Colour Plate
The ready-to-print version of the CaliPhoto colour plate is given in Figure A1. Figure A1. The ready-to-print CaliPhoto colour plate. The colour plate consists of a white 4:3 ratio rectangle (without the CaliPhoto logo line), surrounded by 24 squares of different colours arranged in a rectangle, surrounding another white rectangle. The centre of the printed colour plate must be cut out and removed in order to obtain the rectangular window in which the sample will be observed.
Choosing the colour plate dimensions is important and depends on the studied materials. For the method to work with high accuracy, the illumination conditions must be the same on the colour Figure A1. The ready-to-print CaliPhoto colour plate. The colour plate consists of a white 4:3 ratio rectangle (without the CaliPhoto logo line), surrounded by 24 squares of different colours arranged in a rectangle, surrounding another white rectangle. The centre of the printed colour plate must be cut out and removed in order to obtain the rectangular window in which the sample will be observed.
Choosing the colour plate dimensions is important and depends on the studied materials. For the method to work with high accuracy, the illumination conditions must be the same on the colour plate and on the material in the window. Depending on the studied materials, the size of the printed colour plate must be reduced such that the topography of the sample surface is minimal within the window. Nevertheless, even if a small colour plate decreases the shadows induced by surface roughness, the sample area appearing in the centre of the colour plate must be large enough to be representative of the material inhomogeneity (colour motif). In addition, it is important to take into account the optics of the imaging system. For very small colour plates (smaller than approximately 2 cm × 1.5 cm with a standard camera), the camera would potentially fail to take a sharp, high-resolution image of the colour plate (out of focus, limited depth of field, etc.). On the other hand, for very large colour plates (larger than approximately >32 cm × 24 cm) the risk of inhomogeneous shadows that are impossible to correct for is increased. Overall, the colour plate must be printed in order to maximise the number of pixels in the photographs taken that are relevant for the objective of the study.
The better the quality of the printer, the better the colours of the corrected images will be. Nevertheless, since CaliPhoto is not a colorimetric method, an "average" quality of printing will not hamper the efficiency of the method because the colour of the squares in the reference image will be obtained from a photograph of the printed colour plate.
Finally, note that the practical manipulation of the colour plate is greatly eased if a part of the paper sheet is left around the colour plate. Using high-grammage paper or card circumvents outward curling of the paper that may result in deformations difficult to correct in the photographs taken.

Appendix B. Making the Reference Image of the Colour Plate
Once printed, the colour plate must be photographed in order to obtain the reference image. It is best to use homogenous solar light illumination for this, and the field of view must be chosen to avoid shadows on the colour plate. Moreover, depending on the print finish, the colour plate may be relatively bright. In this case, it is important to find an orientation that avoids light reflections on the colour plate. Finally, it is strongly advised to use the same camera for this step and the rest of the study. Indeed, we have demonstrated that, after correction, the differences in RBG values are slightly higher when the cameras used are different for each step (see Figure A2). plate and on the material in the window. Depending on the studied materials, the size of the printed colour plate must be reduced such that the topography of the sample surface is minimal within the window. Nevertheless, even if a small colour plate decreases the shadows induced by surface roughness, the sample area appearing in the centre of the colour plate must be large enough to be representative of the material inhomogeneity (colour motif). In addition, it is important to take into account the optics of the imaging system. For very small colour plates (smaller than approximately 2 cm × 1.5 cm with a standard camera), the camera would potentially fail to take a sharp, highresolution image of the colour plate (out of focus, limited depth of field, etc.). On the other hand, for very large colour plates (larger than approximately >32 cm × 24 cm) the risk of inhomogeneous shadows that are impossible to correct for is increased. Overall, the colour plate must be printed in order to maximise the number of pixels in the photographs taken that are relevant for the objective of the study.
The better the quality of the printer, the better the colours of the corrected images will be. Nevertheless, since CaliPhoto is not a colorimetric method, an "average" quality of printing will not hamper the efficiency of the method because the colour of the squares in the reference image will be obtained from a photograph of the printed colour plate.
Finally, note that the practical manipulation of the colour plate is greatly eased if a part of the paper sheet is left around the colour plate. Using high-grammage paper or card circumvents outward curling of the paper that may result in deformations difficult to correct in the photographs taken.

Appendix B: Making the Reference Image of the Colour Plate
Once printed, the colour plate must be photographed in order to obtain the reference image. It is best to use homogenous solar light illumination for this, and the field of view must be chosen to avoid shadows on the colour plate. Moreover, depending on the print finish, the colour plate may be relatively bright. In this case, it is important to find an orientation that avoids light reflections on the colour plate. Finally, it is strongly advised to use the same camera for this step and the rest of the study. Indeed, we have demonstrated that, after correction, the differences in RBG values are slightly higher when the cameras used are different for each step (see Figure A2). Figure A2. Effects of using different cameras during the CaliPhoto image processing. (a) Reference image of the colour plate made using a photocopier (Ricoh MP C2504ex) and (b) image of the same colour plate made using a tablet camera (iPad) after correction (see details in Appendix B and C). The value of Δ given by Equation (1) (see main text) is 0.9%. When using the tablet camera throughout (i.e., to make the reference image of the colour plate, image in (c), and the image to correct) the value of Δ is decreased to 0.6%, as displayed in (d).
The photograph of the colour plate must then be processed in order to obtain the reference image. For this, the perspective must be corrected and the image resized. This can easily be done using image processing software. The example is given in Figure A3 uses GIMP.  The photograph of the colour plate must then be processed in order to obtain the reference image. For this, the perspective must be corrected and the image resized. This can easily be done using image processing software. The example is given in Figure A3  he final reference image of the colour plate is obtained after light, brightness and con ctions. This image processing, described in Figure A4, is performed using mathema are (MATLAB Code S1), and is as follows: The rescaled and resized image ( Figure A4a  The final reference image of the colour plate is obtained after light, brightness and contrast corrections. This image processing, described in Figure A4, is performed using mathematical software (MATLAB Code S1), and is as follows: (i). The rescaled and resized image ( Figure A4a) is imported in MATLAB. (ii). The RGB channels of the image are extracted and converted into double format ( Figure A4b). (iii). Pixels corresponding to the white rectangles surrounding the colour squares and the window on each of the three images are selected (see Figure A4c). (iv). The light source creates a homogeneous variation in brightness over the colour plate that can be fitted, for each R, G, B channel, by a polynomial plane equation (of order 3 in the example shown) determined from the two white rectangles selected in (iii) ( Figure A4c). (v). The principle then becomes similar to the data processing method called "plane fit", used in Scanning Probe Microscopy to correct the slope of the sample surface [11], consisting of removing the calculated plane from the whole image. In the CaliPhoto method, the plane removal is made in order to set the average value of the white rectangles to R,G,B = 230,230,230 ( Figure A4d). following step. This step also corrects the chromaticity of the illumination source by resetting the white balance. If the colour print is of lower quality (e.g., the white square appearing a more yellow in the printed colour plate), this step may also lead to apparent colours that are unattractive to human expectations in the processed image. However, it is important to note that, unlike colorimetric methods, this aspect of "unattractiveness" will not alter the accuracy of the method. (vi). The next step involves brightness and contrast correction. This is done by fitting the average value of the greyscale rectangles of the colour plate to their theoretical values, using a polynomial regression of order 3 ( Figure A4e). (vii). Finally, it is possible to extract, as an Excel file for example, the average values of the colour squares of the reference image of the colour plate (Table A1).

Appendix C. Making the CaliPhoto Image of the Material
The conditions and the parameters used to take photographs of the studied materials will be described in detail in Appendix D. Nevertheless, the recommendations relevant for the photograph used to make the reference image in Appendix B also apply for these photographs.
The processing of the image for calibration with respect to the reference image is similar to those described in Appendices A and B, but adds a final image processing for colour correction (see main text Figure 3). The associated MATLAB is available in Supplementary Materials (Code S2). This step consists of evaluating the coefficients of the polynomial transformation using the least squares method and minimizing the differences between the RGB values of the colour squares on both the image for calibration and the reference image [6]. At order 3, it requires searching for the coefficients a i , b i , c i such that: where the IM matrix refers to the image to be corrected and the REF matrix refers to the reference image. At order 6, it consists of searching for the coefficients a i , b i , c i such that:  and et cetera with increasing order. In our case, this equality is never reached, which is why the coefficients a i , b i , c i are obtained from a least squares solution to the system. The coefficients ai, bi, ci allow correction of the RGB channels of the sample image obtained after step vi) in Appendix B using, at order 3, the following Equations (A3): or at order 6, the Equations (A4): and et cetera with increasing order. In our case, we used a polynomial transformation of order 11, meaning that the RGB channels are corrected using Equations (A5): R final = a 1 R + a 2 G + a 3 B + a 4 R.G + a 5 G.B + a 6 R.B + a 7 R.B + a 8 R 2 + a 9 G 2 + a 10 B 2 + a 11 R.G.B Several tests were carried out to evaluate the effect of polynomial order used on the colour correction process, examples of which are displayed in Figure A5. Here, it is shown that order 11 is always associated with the best correction, regardless of either the size of the colour plate on the image for correction and/or the illumination, as shown in Figure A6.  (1), is reported on each image. The best correction is obtained at order 11 (Δ = 0.61%). Photographs taken using a tablet camera (iPad).  Finally, it is possible to extract, as an Excel file for example, the average values of the colour squares of the colour plate on the corrected image in order to compare them with those of the reference image (see Appendix B, §vii). Table A2 compares the RGB values of the colour squares before and after correction using the CaliPhoto method for the example displayed in Figure A6. Table A2. RGB values of the colour square of the colour plate on the reference image in Figure A5b and on the initial and final image to correct in Figure A5c,h, respectively. The average value of Δ between the image to correct and the reference image is 13.78% before correction and only 0.61% after CaliPhoto correction. Finally, it is possible to extract, as an Excel file for example, the average values of the colour squares of the colour plate on the corrected image in order to compare them with those of the reference image (see Appendix B, §vii). Table A2 compares the RGB values of the colour squares before and after correction using the CaliPhoto method for the example displayed in Figure A6. Table A2. RGB values of the colour square of the colour plate on the reference image in Figure A5b and on the initial and final image to correct in Figure A5c,h, respectively. The average value of ∆ between the image to correct and the reference image is 13.78% before correction and only 0.61% after CaliPhoto correction.

Appendix D. Testing the CaliPhoto Image Processing
It is obviously ideal to make a good image of the sample with the colour plate, that is, preferentially using homogenous solar light illumination, avoiding over-and underexposure and minimising high perspective effects. In the case of the photograph used to make the reference image, close attention must be paid in order to avoid shadows and reflections on the colour plate by choosing the appropriate orientation. Consequently, the accuracy of the method can be improved by optimising the photography conditions and the parameters used to take the photographs of the studied materials.

Appendix D.1. Effect of Colour Plate Size in the Original Photographs on the CaliPhoto Method
As noted previously, it is better to use the same camera to make both the photographs of the study samples and the reference image of the colour plate (see Figure A2). Nevertheless, it appears that the size of the colour plate in pixels in the photographs prior to processing plays an even more important role than the camera used; if the sizes (in pixels) of the colour plates in the two photographs are close, the image processing is seen to be more efficient, as illustrated in Figure A7. study samples and the reference image of the colour plate (see Figure A2). Nevertheless, it appears that the size of the colour plate in pixels in the photographs prior to processing plays an even more important role than the camera used; if the sizes (in pixels) of the colour plates in the two photographs are close, the image processing is seen to be more efficient, as illustrated in Figure A7. Figure A7. Initial resolution dependency for CaliPhoto image processing. (a) Reference image of the colour plate made using a photocopier (Ricoh MP C2504ex) and (b) image of the same colour plate made using a tablet camera (iPad), in order to obtain a similar size (in pixels) for the colour plate in the original photograph and in the photocopied image. The value of ∆, given by Equation (1) (see main text), is equal to 1.1%. When using the tablet to make the reference image of the colour plate (c) and the image to correct but with a resolution approximately two times higher, ∆ = 1.2%, as displayed in (d). This shows that the correction process depends more on the difference of initial resolution of the colour plate than on the imaging systems used. (e) Graph showing ∆ after correction versus the difference of the size of the colour plate in pixels between the image to correct and the reference image in % for a series of images. The best correction is obtained when the size of the colour plate on the image is close to the size of the colour plate on the reference image before resizing.
contrast, as defined above, are higher than approximately 100; this corresponds to relatively dark and low-contrast images.
where R, G and B are the average values of R, G, B over a considered square within the colour plate. Then, we used the luminance of the white square of the colour plate to measure the original brightness of the photographs, and the difference between the luminance of the white and black squares to measure the original contrast of the photographs. The value of Δ versus these parameters is displayed in Figure A8. It is shown that the CaliPhoto processing works when the brightness and the contrast, as defined above, are higher than approximately 100; this corresponds to relatively dark and low-contrast images.

D.3. Effect of Light "Colour" on the CaliPhoto Method
Similarly, we studied the effect of the hue of the photograph, induced by the colour of the light source and by the camera, on the image processing. Thus, we defined parameter C corresponding to the deviation in white balance observed on the white square as: Thus, when illuminated with a blue light, the white square will appear blue (R,G,B = 200, 200, 250 for example) and the value of C will be positive (equal to 50 in the example). The value of Δ versus C is displayed in Figure A9. The colour of the light source does not seem to play a role in the CaliPhoto correction. Figure A9. Hue dependency on the CaliPhoto image processing. Δ after CaliPhoto correction versus C, the variation in colour of the white square defined by Equation (A7). The "colour" of the original photograph does not seem to play a role in the accuracy of the CaliPhoto image processing.

D.4. Recommendations for Photographers and Printers
Finally, to summarize, in order to improve the accuracy of the CaliPhoto image correction processing, several key procedural points should be considered. In order of importance: 1. The luminance of the white square in the photographs must be higher than 100. 2. The contrast, obtained from the difference of luminance between the white and black squares in the photographs, must be higher than 100. 3. Do not use folded colour plates or colour plates that have curled outward.  The database may also include the uncertainty on the colours, given by 256 × Δ. Table A3 shows the values of Δ ij and Δ for each square and each of the reference sample images after correction. The database created, including uncertainties, is displayed in Table A4. Table A3. Values of Δ12 for each colour square of the colour plate and values of Δ for the different images of the coloured paper, displayed in Figure A10. The average global variation is only 1.15%.  The database may also include the uncertainty on the colours, given by 256 × ∆. Table A3 shows the values of ∆ ij and ∆ for each square and each of the reference sample images after correction. The database created, including uncertainties, is displayed in Table A4. Table A3. Values of ∆ 12 for each colour square of the colour plate and values of ∆ for the different images of the coloured paper, displayed in Figure A10. The average global variation is only 1.15%. It is then possible to identify a material using the same image correction processing and by comparing its CaliPhoto colour to the values stored in the database (see Figure 5, main text). For that purpose, we defined a matching parameter given by:

Sample
The results are displayed in Table A5. Table A5. Identification of a sample (orange paper) using a CaliPhoto database. The best match occurs for the orange paper, which has a matching percentage M ij = 99%. The second-best match occurs for the yellow paper which, to the human eye, is not very different from the orange paper.

. Identification Using CaliPhoto Colour Vectors
The identification method can be improved by using more complex parameters to create the database. Indeed, for nonhomogeneous materials, the average colour of two materials may be similar, as illustrated in Figure A11.
It is then possible to identify a material using the same image correction processing and by comparing its CaliPhoto colour to the values stored in the database (see Figure 5, main text). For that purpose, we defined a matching parameter given by: The results are displayed in Table A5. Table A5. Identification of a sample (orange paper) using a CaliPhoto database. The best match occurs for the orange paper, which has a matching percentage Mij = 99%. The second-best match occurs for the yellow paper which, to the human eye, is not very different from the orange paper.

E.2. Identification Using CaliPhoto Colour Vectors
The identification method can be improved by using more complex parameters to create the database. Indeed, for nonhomogeneous materials, the average colour of two materials may be similar, as illustrated in Figure A11.  To circumvent this issue, we propose using the histograms of the RGB values to define a CaliPhoto colour vector given by: This method takes into account the inhomogeneity of materials in the CaliPhoto database. The identification of a material is made using the parameter ∆V ij , defined as: However, inhomogeneous materials of different colours may be associated with similar CaliPhoto vectors, defined using Equation (A9), as illustrated in Figure A12. To circumvent this issue, we propose using the histograms of the RGB values to define a CaliPhoto colour vector given by: where This method takes into account the inhomogeneity of materials in the CaliPhoto database. The identification of a material is made using the parameter ΔVij, defined as: However, inhomogeneous materials of different colours may be associated with similar CaliPhoto vectors, defined using Equation (A9), as illustrated in Figure A12. Thus, in order to obtain unique CaliPhoto vectors taking into account the colour inhomogeneity of materials, we defined Veci, given by Equation (3) and depending on the histograms converted in rg chromaticity (r,g,b) and luminance (µ). The MATLAB code giving this vector is provided in Supplementary Materials (Code S3). We also defined the parameter ΔVecij, given by Equation (4), for the comparison and identification of materials. The matching parameter can now be written as: Finally, it important to note that, with CaliPhoto vectors defined using Equation (3), it is not possible to differentiate materials of similar colours but exhibiting different textures, as illustrated in Figure A13. Nevertheless, this aspect is not relevant for the CaliPhoto method that was designed for textureless materials. Thus, in order to obtain unique CaliPhoto vectors taking into account the colour inhomogeneity of materials, we defined Vec i , given by Equation (3) and depending on the histograms converted in rg chromaticity (r,g,b) and luminance (µ). The MATLAB code giving this vector is provided in Supplementary Materials (Code S3). We also defined the parameter ∆Vec ij , given by Equation (4), for the comparison and identification of materials. The matching parameter can now be written as: Finally, it important to note that, with CaliPhoto vectors defined using Equation (3), it is not possible to differentiate materials of similar colours but exhibiting different textures, as illustrated in Figure A13. Nevertheless, this aspect is not relevant for the CaliPhoto method that was designed for textureless materials. The CaliPhoto RGB values stored in the database of coloured papers can be replaced by the newly defined CaliPhoto vectors, and material identification can be performed using Equation (A11). The results of this test are displayed in Table A6. Table A6. Identification of a sample (orange paper) using the coloured paper CaliPhoto vector database. The best match is the orange paper, with a match percentage M = 83%. The second-best match occurs for the yellow paper, but the match percentage is only 26%. Obviously, the images displayed in Figures A10-A12 were made to show the proportion of the different colours of pixels over the area. For the textureless materials considered in this study, the distribution of the colours would be indiscriminately spread over the analysed area; the colour plate size must be chosen according to that described in §S1.

Sample to Identify Orange
We demonstrated in Appendix C that the proposed image processing permits recalibration of the RGB values of different materials in order to obtain specific CaliPhoto colour spaces in which each material is associated with a specific vector. Irrespective of the light and geometry conditions in which the photographs are taken, following the relatively straightforward recommendations in Appendix D4, the variability on the CaliPhoto vector of a given material is approximately 1.5%. Based on this small variability, we demonstrated in Appendix E that the CaliPhoto method provides a rapid and uncomplicated method to identify a material by comparison with a database of CaliPhoto vectors taken from known materials.
In this example, the CaliPhoto vectors stored in the reference database are associated with the parameter "colour" (blue, green, etc.). Of course, the aim of the method is to be able to link these values to less obvious physical parameters, potentially obtained using more powerful and/or expensive systems such as field spectrometers. The CaliPhoto RGB values stored in the database of coloured papers can be replaced by the newly defined CaliPhoto vectors, and material identification can be performed using Equation (A11). The results of this test are displayed in Table A6. Table A6. Identification of a sample (orange paper) using the coloured paper CaliPhoto vector database. The best match is the orange paper, with a match percentage M = 83%. The second-best match occurs for the yellow paper, but the match percentage is only 26%. Obviously, the images displayed in Figures A10-A12 were made to show the proportion of the different colours of pixels over the area. For the textureless materials considered in this study, the distribution of the colours would be indiscriminately spread over the analysed area; the colour plate size must be chosen according to that described in §S1.

Sample to Identify
We demonstrated in Appendix C that the proposed image processing permits recalibration of the RGB values of different materials in order to obtain specific CaliPhoto colour spaces in which each material is associated with a specific vector. Irrespective of the light and geometry conditions in which the photographs are taken, following the relatively straightforward recommendations in Appendix D.4, the variability on the CaliPhoto vector of a given material is approximately 1.5%. Based on this small variability, we demonstrated in Appendix E that the CaliPhoto method provides a rapid and uncomplicated method to identify a material by comparison with a database of CaliPhoto vectors taken from known materials.
In this example, the CaliPhoto vectors stored in the reference database are associated with the parameter "colour" (blue, green, etc.). Of course, the aim of the method is to be able to link these values to less obvious physical parameters, potentially obtained using more powerful and/or expensive systems such as field spectrometers.

Appendix F. Precharacterisation of Materials Using the CaliPhoto Method
The philosophy of the CaliPhoto method is to permit rapid and low-cost precharacterisation of material in order to select the samples most suited for further investigation (on-site collection of samples in the field or sample control prior to expensive and long analyses, for example). From this perspective, the principle is to use a suite of well-characterised materials permitting to link one, or several, specific physical properties of interest to their CaliPhoto RGB values or vectors in a database. Then, using this database, these properties will be estimated for unknown materials only based on their CaliPhoto RGB values or vectors.
As an example, we estimated the concentrations in a mixture of two paints. First, a size-adapted reference colour plate was printed and photographed, prior to being processed in order to obtain the CaliPhoto reference image ( Figure A14a). Then, photographs of well-characterised mixtures were taken and processed to obtain their CaliPhoto RGB values ( Figure A14b). Finally, a database was made linking the paint concentrations to their associated CaliPhoto RGB values (see Table A7).

Appendix F: Precharacterisation of Materials Using the CaliPhoto Method
The philosophy of the CaliPhoto method is to permit rapid and low-cost precharacterisation of material in order to select the samples most suited for further investigation (on-site collection of samples in the field or sample control prior to expensive and long analyses, for example). From this perspective, the principle is to use a suite of well-characterised materials permitting to link one, or several, specific physical properties of interest to their CaliPhoto RGB values or vectors in a database. Then, using this database, these properties will be estimated for unknown materials only based on their CaliPhoto RGB values or vectors.
As an example, we estimated the concentrations in a mixture of two paints. First, a size-adapted reference colour plate was printed and photographed, prior to being processed in order to obtain the CaliPhoto reference image ( Figure A14a). Then, photographs of well-characterised mixtures were taken and processed to obtain their CaliPhoto RGB values ( Figure A14b). Finally, a database was made linking the paint concentrations to their associated CaliPhoto RGB values (see Table A7).  From these data, it is possible to plot the evolution of RC, GC and BC with the concentration in yellow paint. These curves can then be used to estimate this concentration in a new mixture (as displayed in Figure 5f-h). In this example, the concentration in yellow was estimated to be 33% ± 5%, whereas the true concentration was 29% ± 1%. The estimated value thus matches closely to the true value. Note that the method would be considerably improved by increasing the number of reference mixtures in the database.

Appendix G: Creation of a Master Colour Plate for the CaliPhoto Method
The most significant restriction of the method comes from the fact that any database is necessarily associated to a given colour plate. If this colour plate is lost or irreversibly altered, the database becomes obsolete.  From these data, it is possible to plot the evolution of R C , G C and B C with the concentration in yellow paint. These curves can then be used to estimate this concentration in a new mixture (as displayed in Figure 5f-h). In this example, the concentration in yellow was estimated to be 33% ± 5%, whereas the true concentration was 29% ± 1%. The estimated value thus matches closely to the true value. Note that the method would be considerably improved by increasing the number of reference mixtures in the database.