Convert BMP files while tracking alpha and byte savings
Admin ·
A BMP can store pixel rows in different orders and may include an explicit alpha mask. Convert the bitmap to a format appropriate for its destination, then compare the actual bytes.
Convert the 192 × 96 sample to PNG
Click Load example to open two-color-sample.bmp. Leave Output format on PNG and click Compress BMP files. The result keeps the 192 × 96 dimensions and lists the new file size next to the original size.
Open Show saved previews to check the two color blocks. The tool can use a palette for PNG when every decoded RGBA value fits exactly and the result is smaller than a full-color PNG.
Microsoft BITMAPV4HEADER referenceW3C Portable Network Graphics Third Edition
Try a byte target without resizing
Choose JPEG or WebP, enter 1 in Optional target, and set Maximum quality to 85. The program checks the bytes actually encoded at the tested quality settings. One KB is 1,000 bytes.
If the tested files exceed the target, keep the downloadable result marked Target not reached or choose Download original BMP. The tool leaves the original dimensions intact.
ITU-T T.81 JPEG coding specificationGoogle WebP container specification
Review alpha and the saved batch
For transparency in a bitmap with an alpha mask, use PNG to retain the decoded samples. WebP supports transparency. JPEG renders opaque white behind transparent and partially transparent pixels.
Open the ZIP and compare the saved file lengths with the report. A truncated bitmap can fail alongside valid files, with its own error and successful files still available.
Microsoft BITMAPV4HEADER referenceW3C Portable Network Graphics Third EditionGoogle WebP container specification
Common questions
Why can a PNG still miss a target?
The PNG keeps decoded samples. Adjusting a lossy quality setting is available for JPEG and WebP.
Why do two BMPs display upright when their rows are stored differently?
The BMP header supplies a signed height for compatible Windows headers. The decoder uses it to place the first stored row at the correct edge.