A method of producing a binary 2D optical code output signal block with a desired spatial density of marked elements, the 2D optical code output signal block comprising an N x N array of element locations, each location having a first or second binary value, the code including a reference signal component and a payload signal component, the reference signal component having a structure that enables geometric synchronization of the optical code when depicted within camera-captured imagery, the method characterised by taking, as inputs, (a) a 2D payload signal block and (b) a 2D reference signal block, the 2D payload signal block comprising an array of M x M binary elements each having first or second values, and each having an associated location within the M x M payload signal block, the 2D reference signal block comprising an array of N x N elements, each element having a value and an associated location within the N x N block, the elements in the reference signal block being multi-valued, characterized in that N > M, the method further including: interpolating the M x M payload signal block to yield an interpolated N x N payload signal block, said interpolating also changing the elements of the payload signal block from M x M binary elements to N x N multi-valued elements; combining the N x N reference signal block and the interpolated N x N payload signal block in a weighted sum by multiplying one of said reference signal or payload signal blocks by a weighting factor, and summing with the other of said signal blocks, to yield a composite code block comprising N x N multi-valued elements, each element of said composite code block having a value whose magnitude establishes a priority of said element, each of said N x N locations in the output signal block spatially corresponding to a respective location in said N x N composite code block; identifying an element of the composite code block having a highest priority, and in said output signal block of N x N locations, in which all locations initially have the first binary value, marking the location corresponding to said identified element with the second binary value; and identifying successive elements of the composite code block having next-highest priorities, and marking successive locations in the output signal block corresponding to said identified elements with the second binary value, until said desired spatial density of marked elements is achieved. interpolating the M x M payload signal block to yield an interpolated N x N payload signal block, said interpolating also changing the elements of the payload signal block from M x M binary elements to N x N multi-valued elements; combining the N x N reference signal block and the interpolated N x N payload signal block in a weighted sum by multiplying one of said reference signal or payload signal blocks by a weighting factor, and summing with the other of said signal blocks, to yield a composite code block comprising N x N multi-valued elements, each element of said composite code block having a value whose magnitude establishes a priority of said element, each of said N x N locations in the output signal block spatially corresponding to a respective location in said N x N composite code block; identifying an element of the composite code block having a highest priority, and in said output signal block of N x N locations, in which all locations initially have the first binary value, marking the location corresponding to said identified element with the second binary value; and identifying successive elements of the composite code block having next-highest priorities, and marking successive locations in the output signal block corresponding to said identified elements with the second binary value, until said desired spatial density of marked elements is achieved.