A method of producing a bitonal 2D optical code output signal block that allows for variable spatial density of marked elements, the 2D optical code output signal comprising a 2D array of element locations, each location having a binary mark or not, wherein less than 50% of the locations have marks, 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 comprising:
- 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×M binary elements each having first or second values, and each having an associated location within the M×M payload signal block, the 2D reference signal block comprising an array of N×N elements where N>M, each element having a value and an associated location within the N×N block, the elements in the reference signal block being multi-valued;
- interpolating the M×M payload signal block to yield an N×N signal block, said interpolating also changing the elements of the payload signal block from M×M binary elements to N×N multi-valued elements;
- combining the N×N reference signal block and the interpolated N×N payload signal block to yield a composite code block comprised of N×N multi-valued elements;
- sorting elements in the N×N composite code block by value, yielding a sorted list of corresponding element locations;
- and
- stepping through the list, placing marks at said corresponding locations within an N×N output signal block, until a desired spatial density of marked elements is achieved;
- wherein a variable spatial density of marked elements is achieved by selecting a smaller or larger number of locations to mark in the N×N output signal block.