Pixel Array. The total number of bytes necessary to store one row of pixels can be calculated as: The total number of bytes necessary to store an array of pixels in an n bits per pixel (bpp) image, with 2n colors, can be calculated by accounting for the effect of rounding up the size of each row to a multiple of 4 bytes, as follows: Pixel array (bitmap data) The pixel array is a block of 32-bit DWORDs, that describes the image pixel by pixel. Usually pixels are stored "bottom-up", starting in the lower left corner, going from left to right, and then row by row from the bottom to the top of the image. Unless is used, uncompressed Windows bitmaps also can be stored from the top to bottom, when the Image Height value is negative. In the original OS/2 DIB, the only four legal values of color depth were 1, 4, 8, and 24 bits per pixel (bpp). Contemporary DIB Headers allow pixel formats with 1, 2, 4, 8, 16, 24 and 32 bits per pixel (bpp). GDI+ also permits 64 bits per pixel. Padding bytes (not necessarily 0) must be appended to the end of the rows in order to bring up the length of the rows to a multiple of four bytes. When the pixel array is loaded into memory, each row must begin at a memory address that is a multiple of 4. This address/offset restriction is mandatory only for Pixel Arrays loaded in memory. For file storage purposes, only the size of each row must be a multiple of 4 bytes while the file offset can be arbitrary. A 24-bit bitmap with Width=1, would have 3 bytes of data per row (blue, green, red) and 1 byte of padding, while Width=2 would have 6 bytes of data and 2 bytes of padding, Width=3 would have 9 bytes of data and 3 bytes of padding, and Width=4 would have 12 bytes of data and no padding. Compression Indexed color images may be compressed with 4-bit or 8-bit RLE or Huffman 1D algorithm. OS/2 2 24bpp images may be compressed with the 24-bit RLE algorithm. The 16bpp and 32bpp images are always stored uncompressed. Note that images in all color depths can be stored without compression if so desired. Pixel format The 1-bit per pixel (1bpp) format supports 2 distinct colors, (for example: black and white).