tinyimg 1.0.0
Lightweight image manipulation library for Cloudflare Workers
Loading...
Searching...
No Matches
bmp.h File Reference

Windows bitmap codec. More...

Go to the source code of this file.

Variables

const TinyCodec tiny_codec_bmp
 The BMP codec.

Detailed Description

Windows bitmap codec.

Author
Gregory Mitchell (me@gm.nosp@m.itch.nosp@m.215.x.nosp@m.yz)
Version
1.0.0
Date
2026-09-01

Variable Documentation

◆ tiny_codec_bmp

const TinyCodec tiny_codec_bmp
extern

The BMP codec.

Decodes 1, 4 and 8 bit palettes, 16 bit packed, 24 bit BGR and 32 bit BGRA, uncompressed or RLE8, in either row order. Encodes 8 bit grayscale, 24 bit BGR, or 32 bit BGRA behind a V4 header when the image carries alpha.

A 32 bit BI_RGB file with only the 40 byte header is read as opaque, because the fourth byte is padding in that layout and reading it as alpha turns a normal image transparent. Alpha is honored when a mask says it is there.

Region and scaled decode read only the rows and columns they need. RLE8 is sequential, so a region of an RLE8 file expands the index plane first.