# `Mx.Scan`
[🔗](https://github.com/mx-music/mx/blob/main/lib/mx/scan.ex#L1)

Prepares scanned score pages for optical music recognition by Audiveris.

A page is turned to grayscale and cropped to the paper, its paper evened to white, the ink showing through from the other side faded, scaled so its staff lines stand about 20 pixels apart, the spacing Audiveris asks for, levelled, and cropped to the columns its staves span.

# `gray`

A page as one band of 8-bit gray.

# `prepare`

Prepares a page, and returns it with its staff line spacing before and after, and the degrees it was turned.

# `spacing`

The distance in pixels from one staff line to the next, or nil on a page without staves.

# `systems`

Cuts a prepared page into its systems, top to bottom, each the full width of the page.

A system is the staves joined by a bar line running from each staff to the next, or a single staff joined to none.
Each reaches halfway to its neighbours, but no further than six staff line spacings from its outer staff lines.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
