A method of manufacturing a security device, comprising: a) providing a depth map of a macroimage depicting a three-dimensional object, the depth map representing the depth of each part of the three-dimensional object relative to a reference plane by means of different colours and/or different tones of one colour; b) segmenting the depth map into a plurality of regions (10a - 10k) based on the colours and/or tones of the depth map, each region comprising those part(s) of the depth map having a colour or tonal value within a respective predetermined range; c) for each region, creating a respective microimage element array, the microimage elements forming the microimage element array being arranged on a regular grid in one or two dimensions with a pitch and orientation which are constant across the region, the periphery of the microimage element array substantially matching that of the region, the resulting plurality of microimage element arrays being arranged relative to one another in the positions of the respective regions in the depth map to form a first image layer; and d) providing a sampling element array of a predetermined pitch and orientation, the sampling element array overlapping the plurality of microimage element arrays, wherein the pitches of the sampling element array and of the microimage element arrays and their relative locations are such that the sampling element array cooperates with each of the microimage element arrays to generate magnified versions of the microimage elements in each region due to the moire effect; wherein the pitch and/or orientation of each respective microimage element array is different, and is configured such that the magnified versions of the microimage elements generated in any one of the regions have a different apparent depth relative to those generated in the other region(s), so as to form a three-dimensional representation of the macroimage. a) providing a depth map of a macroimage depicting a three-dimensional object, the depth map representing the depth of each part of the three-dimensional object relative to a reference plane by means of different colours and/or different tones of one colour; b) segmenting the depth map into a plurality of regions (10a - 10k) based on the colours and/or tones of the depth map, each region comprising those part(s) of the depth map having a colour or tonal value within a respective predetermined range; c) for each region, creating a respective microimage element array, the microimage elements forming the microimage element array being arranged on a regular grid in one or two dimensions with a pitch and orientation which are constant across the region, the periphery of the microimage element array substantially matching that of the region, the resulting plurality of microimage element arrays being arranged relative to one another in the positions of the respective regions in the depth map to form a first image layer; and d) providing a sampling element array of a predetermined pitch and orientation, the sampling element array overlapping the plurality of microimage element arrays, wherein the pitches of the sampling element array and of the microimage element arrays and their relative locations are such that the sampling element array cooperates with each of the microimage element arrays to generate magnified versions of the microimage elements in each region due to the moire effect;