BmpLib is a lightweight, dependency-free JavaScript library for working with BMP (bitmap) image files at the binary level. It allows you to read, manipulate, and export BMP images using low-level ArrayBuffer, DataView, and Uint8Array operations.
⚠️ Note: This project is currently under active development. APIs and features may change, and not all image processing operations have been implemented yet.
- Rotation (90° increments)
- Crop
- Flip (horizontal/vertical)
- Grayscale (multiple methods)
- Resize (Nearest Neighbor, Bilinear, Box Filter, Bicubic)
- Works with BMP images directly at the byte level.
- Built on top of
ArrayBuffer,DataView, andUint8Arrayfor efficient memory manipulation. - Rollup used to bundle for both CommonJS (CJS) and ECMAScript Module (ESM) formats.
BmpLib is intentionally designed to be minimal and performant. Features like 1-bit dithering and halftoning — which require heavier algorithms and additional computation — may be implemented in a separate branch to maintain a clean and focused core version.
- Export functionality
- Brightness & contrast adjustments
- (Optional) Advanced branch for 1-bit effects like dithering & halftoning
Usage examples and full documentation will be added as the library matures.
MIT