Each data buffer stores the image data using two bytes per pixel for a 0 to 65535 data range (16 bits). Even if you load a file with a lesser number of bits per pixel, the data will be converted to 16 bit format. Each video buffer is sized according to the video mode selected in the Configuration setup and each pixel is represented by one byte ( 8 bits) which allows for 190 levels of gray.
Thus, the amount of XMS memory will depend upon the Configuration parameters you input to the program. The following table shows some examples
Max Image Size Video XMS Memory Required (Cols x Rows) (kB) 192 x 165 VGA - 320x200 448 k 375 x 244 VESA - 640x480 1655 k 765 x 510 VESA - 800x600 4508 kIn general, the amount of XMS memory needed is given by
XMS needed = 3*(VideoRows*VideoCols) + 8*(MaxImageCols*MaxImageRows)
(actually a bit more because the XMS driver only allocates memory in units or 1024 bytes). If this seems like a lot, you must remember that you are doing some pretty sophisticated things with a huge amount of primary data. Fortunately, memory prices have dropped considerably.
If you don't have enough XMS memory to support your configured sizes, the program will first allocate the video buffers and then will divide the remaining memory into the four data buffers and will set the maximum image size using a 4:3 ratio to preserve square pixels. If you don't have enough memory to support the video buffers, the program will abort.