Skip to content

About

The 'bmp.h' library handles Bitmap format images and allows you to load, work with, convert or generate *.bmp files in an exclusive C subsystem environment.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitmap C Library

The bmp.h library handles Bitmap format images and allows you to load, work with, convert or generate *.bmp files in an exclusive C subsystem environment.

The Portuguese version of this README is still to be written.

Description

This project is intended to be used during the "Digital Image Processing" course (for the Electrical and Computer Engineering programs) at the Federal University of Amazonas, in Brazil.

Sample images in use

  • Redbricks.bmp is an example of a 4 bits per pixel image (hexadecimal output taken from the Microsoft Docs Bitmap Storage page) given by the bmp_getredbricks() function.
  • gradient.bmp is an example of a 8 bits per pixel image generated by the bmp_8bpp_sample() function.
  • redblue.bmp is an example of a 16 bits per pixel image generated by the bmp_16bpp_sample() function.
  • monarchs.bmp is an example of a 24 bits per pixel image.
  • greenblue.bmp is an example of a 32 bits per pixel image generated by the bmp_32bpp_sample() function.

All the samples mentioned above were generated using my own bmp.h library while monarchs.bmp was simply taken from the "Yu-Gi-Oh! TCG ©️" card "Pantheism of the Monarchs".

Some generic samples used during the classes

  • drip-bottle.bmp;
  • girl.bmp;
  • hidden-horse.bmp;
  • moon.bmp;
  • rose.bmp;
  • salt-pepper.bmp;
  • spillway-dark.bmp;
  • testpattern.bmp;

All of them are well known images used for this purpose. Notice that they are all in Bitmap format. All of them were converted from their respective *.tif/*.tiff format using some online TIF to BMP converter and then rearranged for a 8 bits per pixel format using this bmp.h library.

salt-pepper.bmp in particular, is compressed using RLE8 (the specified BMP_BI_RLE8 compression type).

Version History

Version Date Description
0.00001 February 04, 2022 First Release:
- Regular structs based on the works of Yung-Hsiang Lu at his book;
- Common processing functions for 24 bits per pixel images only;
- Color filtering function;
- Invert colors function;
- Equalize colors function;
- Print image headers and specified pixel functions;
- Get pixel values function;
0.00002 March 06, 2022 Second Release:
- Defined filetypes to support (or add support in the future);
- Included standardizations from Microsoft Metafile Format specification;
- Specified enumerations for multiple DIB headers (LEGACYHEADER, COREHEADER, INFOHEADER, V4HEADER and V5HEADER);
- Support conversion from 24-bits per pixel to 8-bits per pixel formats;
- Included RGB to Gray Scale conversion function;
0.00003 March 16, 2022 Third Release:
- Defined Bitfields masks for 16bpp and 32bpp images;
- Defined color spaces for both V4HEADER and V5HEADER fields;
- Organized the repository;
- Included sample images being used;
- Refactored all code;
- Implemented functions that return sample images as example (including the Redbricks example);
0.00004 March 16, 2022 Added:
- Implementation of new padding functions.
0.00005 March 26, 2022 Added:
- Complete integration of padding functions to the bmp.h library;
0.00006 March 30, 2022 Updated:
- README.md;
0.00007 April 06, 2022 Added:
- Support for reading BITMAPV4HEADER;
- Support for reading BITMAPV5HEADER;
- Utility functions;
- New structures formats;
- Support for reading 16bpp and 32bpp images;
- Intent enumeration;

Removed:
- Support for legacy headers;
- Support for core header;
0.00008 April 17, 2022 Support for RLE8 decoding:
Added:
- bmp_rle8duo structure;
- bmp_getncolors() function;
- bmp_cpdibs() function;
- bmp_rle8decoder() function;

Modified:
- bmp_read() function: now implements adjustments on the palette size readings;
- bmp_save() function: now supports writing v4 & v5 headers and add pads for the image lines;
- bmp_getpalettesize() function: adjusted to return total byte size;
0.00009 April 18, 2022 Updated:
- README.md;

Minor updates:
- Better variable names;
- Improved generic functions to support more bits per pixel formats;

About

The 'bmp.h' library handles Bitmap format images and allows you to load, work with, convert or generate *.bmp files in an exclusive C subsystem environment.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages