bmp_io, a C++ code which reads or writes the graphics information in a Microsoft BMP file.
A user program can employ these routines to read a BMP file and extract and return the graphics information (RGB pixel arrays), or to write internal RGB pixel arrays into a properly formatted BMP file. The BMP file format is used for many of the icons seen cluttering up the desktop of a Windows machine, for instance.
Of course, another interesting application is to read in a BMP file, and write out the RGB information to a file in another format.
Since some of the data is multibyte, the format of the file can depend on whether such data is written with the bytes in "little-endian" or "big-endian" order. The program maintains a variable called BMP_BYTE_SWAP which controls how the program assumes the bytes are ordered. Setting this variable to true show be the appropriate value for little-endian ordering, while false is for big-endian. This variable can be read by calling the function bmp_byte_swap_get, or set by calling bmp_byte_swap_set.
The information on this web page is distributed under the MIT license.
bmp_io is available in a C++ version.
bmp, a data directory which contains example BMP files.
bmp_to_ppma, a C++ code which converts BMP files to ASCII PPM format.
bmp_to_ppmb, a C++ code which converts BMP files to binary PPM format.
ppma_to_bmp, a C++ code which converts ASCII PPM files to BMP format.
ppmb_to_bmp, a C++ code which converts binary PPM files to BMP format.