Source: wikibot/zigzag-code

= Zigzag code
{wiki=Zigzag_code}

Zigzag code, also known as zigzag encoding, is a technique used primarily in data compression and error correction, particularly in contexts like run-length encoding or within certain video and image compression standards such as JPEG encoding. The main concept of zigzag coding is to traverse a two-dimensional array (like an 8x8 block of pixels in an image) in a zigzag manner, rather than in a row-major or column-major order.