Explanation:

This command sets the threshold values for user-defined dither patterns. The patterns defined with this command can be selected by the ESC B command.

Parameter i can be 0 or 1, allowing you to define two dither patterns.

Parameter j determines the number of pixels on one side of the dither matrix square. The square can be 4 × 4, 8 × 8, or 16 × 16 pixels.

Parameter d is data representing the threshold values of the pixel positions in the matrix. The number of bytes of threshold data is determined by parameter j, and should be j2 bytes. For example, when j = 4, the threshold data required is 16 bytes ; and when j = 8, the threshold data required is 64 bytes.

The threshold data assigns threshold values to pixel positions in the matrix from top left to bottom right, as shown below. Since the value of the input image data can range from 0 (dark) to 255 (bright), each byte of threshold data can take a value ranging from 0 to 255.

An example of a 4 x 4 spiral pattern is shown below.

Command Reference 3-51