A computer-implemented method of producing a 2D machine readable code from binary message data and a ranked list of locations of the first M highest or lowest values within an N × N array of multi-valued reference signal values, the 2D machine readable code comprising plural output code elements, each of said output code elements having a first or second value and having a location in an N × N array of output code elements, each location in said N × N array of output code elements spatially-corresponding to a respective location in said N × N array of reference signal values, the method including: for each of plural bits of message data: associating said bit with a respective one of said locations of highest or lowest values in the N × N array of reference signal values; and expressing said bit in the 2D machine readable code by setting an output code element to the first or second value, depending on whether said bit of the message data has a first or second binary value, said output code element having a location in the N × N array of output code elements that spatially-corresponds to said respective one of said locations of highest or lowest values in the N × N array of reference signal values; wherein only a fraction of the locations within the N × N array of reference signal values are locations of highest or lowest values, the fraction being less than 50% of the image locations, and only a spatially-corresponding fraction of the locations in the N × N array of output code elements are locations at which output code elements may express bits of the message data, and the method further comprises the steps of: employing a first set of the locations of highest or lowest values as fixed marks, solely to express the reference signal, the first set of the locations being drawn from scattered locations within the ranked list; and allocating a second set of the locations of highest or lowest values for expression of bit values, to express the message data and to express the reference signal. associating said bit with a respective one of said locations of highest or lowest values in the N × N array of reference signal values; and expressing said bit in the 2D machine readable code by setting an output code element to the first or second value, depending on whether said bit of the message data has a first or second binary value, said output code element having a location in the N × N array of output code elements that spatially-corresponds to said respective one of said locations of highest or lowest values in the N × N array of reference signal values; wherein only a fraction of the locations within the N × N array of reference signal values are locations of highest or lowest values, the fraction being less than 50% of the image locations, and only a spatially-corresponding fraction of the locations in the N × N array of output code elements are locations at which output code elements may express bits of the message data, and the method further comprises the steps of: employing a first set of the locations of highest or lowest values as fixed marks, solely to express the reference signal, the first set of the locations being drawn from scattered locations within the ranked list; and allocating a second set of the locations of highest or lowest values for expression of bit values, to express the message data and to express the reference signal. employing a first set of the locations of highest or lowest values as fixed marks, solely to express the reference signal, the first set of the locations being drawn from scattered locations within the ranked list; and allocating a second set of the locations of highest or lowest values for expression of bit values, to express the message data and to express the reference signal. <EOS>