
BMP to PNG
Repack a BMP as a PNG. Same pixels, a fraction of the bytes: this is the conversion changing the size of a file without changing the picture.
BMP to PNG repacks the same pixels, and decoding both files gives matching colours. The exception is alpha: a 32-bit BMP whose alpha bytes are all zero reads back opaque, since the format leaves that byte undefined. The bytes a BMP spends on flat colour are the bytes deflate removes, so a photograph gains far less than a screenshot does.
Questions
Does this change the picture?
No. The pixels are identical; this conversion only changes how they are stored, from uncompressed BMP bytes to lossless PNG compression, with nothing added or removed from the image.
What about an 8-bit palette BMP?
An 8-bit palette BMP is already limited to 256 colors before this tool sees it, and PNG stores whatever those 256 colors were, exactly, with no further reduction. A run-length-encoded BMP is refused rather than misread.
Which engine handles this?
A dedicated BMP decoder in this codebase reads the file and jSquash encodes the PNG. Both run in Node, on the command line, through MCP and in the browser.
What size should I expect?
Much smaller in most cases, since PNG compression finds real savings in an uncompressed bitmap, particularly for images with flat color or repeated pixels.
What is the reverse page?
PNG to BMP runs the opposite direction and grows the file back to an uncompressed 32-bit bitmap, with no change to the picture either way.