Image conversion guides

Convert BMP artwork to PNG and check its edges

·

Check the orientation, palette colors and alpha channel of a bitmap after lossless PNG export. The browser reads the file and creates the download on your device.

BMP to PNG

Check a palette with a known color

A 65 × 41 indexed BMP with a red top-left quadrant and a blue lower-left quadrant should show those same quadrants in the PNG. The odd width also checks that row padding in the BMP has been interpreted correctly. The export stores decoded colors, so editing the old palette indices requires the original bitmap.

Look at the transparent and opaque regions

Place the PNG over white, then over black. A transparent corner reveals each background and a partly transparent edge blends with it. A solid white corner in the source remains solid white. PNG preserves the pixels supplied by the decoder.

Check an odd-width bitmap for a row-alignment error

Use a test image with an unmistakable vertical line on the right edge. In an odd-width bitmap the source rows can include alignment bytes. The line should remain vertical and the PNG width should equal the image width, without an extra column for padding.

If the decoder rejects the file outright, check whether it came from the clipboard as a DIB. Save a standalone bitmap from its editor before retrying.

Microsoft bitmap file storage documentation

Common questions

Does PNG encoding change the BMP row order?

The exported image uses the displayed orientation. Supported bottom-up and top-down BMPs depicting the same picture produce the same visible result.

What happens to the unused fourth byte of a bitmap pixel?

A 32-bit BMP can have an unused byte or a declared alpha channel. Transparency depends on the source masks and the browser decoder. An ordinary opaque BMP stays opaque.

Sources

Put it into practice.

Related guides