Samples per inch

Samples per inch (SPI) is a measurement of the resolution of an image scanner, in particular the number of individual samples that are taken in the space of one linear inch. It is sometimes misreferred to as dots per inch, though that term more accurately refers to printing resolution. Generally, the greater the SPI of a scanner, the more detailed its reproduction of the scanned object.

Typical consumer-level flatbed scanners are capable of optical resolution ranging from 100 to 2400 SPI; high-end scanners may have an optical resolution of 4800 SPI or more. Many scanners use interpolation techniques to achieve a higher effective SPI rating, with some manufacturers offering nearly one million SPI, though the quality is primarily limited by the optical resolution; interpolated SPI does not provide additional pixels in the scanned image.

Horizontal and vertical SPI ratings may differ for a given scanner; typical flatbed scanners use a horizontal array of sensors that are passed across the bed using an electric stepper motor. The density of the array of sensors determines the horizontal scanning resolution, while the minimum step size of the motor determines the vertical resolution. Similar characteristics are present in drum scanners, which continuously spin the item being scanned past the sensor array for numerous imaging passes.

To calculate the number of raw data bytes that a scanned image will take up, you can use the follow formula : $$\tfrac{vSPI\ *\ hSPI\ *\ area\ *\ color~depth~encoding}{8}$$

Where :

vSPI is the vertical SPI

hSPI is the horizontal SPI (can be considered the same as vSPI if not specified specifically)

area is the squared area of the scanned document in inches²

color depth encoding is the number of bits used to encode a given amount of color information (256 colors=8; 65'536 colors=16; 16million colors=24)

Remember that this will give raw data bytes, images are almost always compressed when saved to disk using lossless (like PNG, TIFF) or lossy image formats (like JPEG).