A method of generating a fingerprint for a gemstone using x-ray imaging,; the method comprising the steps of: mounting the gemstone in a sample holder of an imaging apparatus, the imaging apparatus comprising a sample holder mounted on a sample stage, at least one x-ray source, the sample holder and the at least one x-ray source aligned along an optical axis, wherein the sample holder is movable in at least one degree of freedom relative to the at least one x-ray source and at least one detector; exposing the mounted gemstone to x-ray radiation from the at least one x-ray source, whilst moving the sample holder relative to the at least one x-ray source and the at least one detector according to a search strategy that is predetermined for the gemstone based on known physical characteristics of the gemstone; using the at least one detector to locate diffraction and/or extinction spots generated by the lattice of the at least one crystal; utilising the located diffraction and/or extinction spots to calculate information about the position, orientation, and phase of the at least one crystal; generating a suitable x-ray diffraction scanning strategy from the calculated information, the strategy including moving the sample holder relative to the at least one x-ray source and the at least one detector and exposing the gemstone to appropriate x- ray radiation from the at least one x-ray source as the sample holder is moved, wherein the strategy is generated to observe a sufficient number and quality of diffraction and/or extinction images for specified lattice planes of the at least one crystal to locate and classify internal imperfections of the crystal lattice; scanning the gemstone according to the scanning strategy and recording the diffraction and/or extinction images using the at least one detector and generating the fingerprint from the recorded diffraction and/or extinction images; characterized by that the fingerprint comprises a three-dimensional map of at least one crystal present within the gemstone including internal imperfections of the at least one crystal, and wherein: the orientation and position of the fingerprint is defined relative to a coordinated three-dimensional model of the outer surface of the gemstone. mounting the gemstone in a sample holder of an imaging apparatus, the imaging apparatus comprising a sample holder mounted on a sample stage, at least one x-ray source, the sample holder and the at least one x-ray source aligned along an optical axis, wherein the sample holder is movable in at least one degree of freedom relative to the at least one x-ray source and at least one detector; exposing the mounted gemstone to x-ray radiation from the at least one x-ray source, whilst moving the sample holder relative to the at least one x-ray source and the at least one detector according to a search strategy that is predetermined for the gemstone based on known physical characteristics of the gemstone; using the at least one detector to locate diffraction and/or extinction spots generated by the lattice of the at least one crystal; utilising the located diffraction and/or extinction spots to calculate information about the position, orientation, and phase of the at least one crystal; generating a suitable x-ray diffraction scanning strategy from the calculated information, the strategy including moving the sample holder relative to the at least one x-ray source and the at least one detector and exposing the gemstone to appropriate x- ray radiation from the at least one x-ray source as the sample holder is moved, wherein the strategy is generated to observe a sufficient number and quality of diffraction and/or extinction images for specified lattice planes of the at least one crystal to locate and classify internal imperfections of the crystal lattice; scanning the gemstone according to the scanning strategy and recording the diffraction and/or extinction images using the at least one detector and generating the fingerprint from the recorded diffraction and/or extinction images; characterized by that the fingerprint comprises a three-dimensional map of at least one crystal present within the gemstone including internal imperfections of the at least one crystal, and wherein: the orientation and position of the fingerprint is defined relative to a coordinated three-dimensional model of the outer surface of the gemstone.