#6972·opentoonz

Rendering of Invalid 8bit Grayscale BMP files

Author: RodneyBakerCreated Jul 28, 2026Updated Aug 26, 2026
Labelsbug

What's the bug?

While reviewing and testing #6965 an unrelated problem was discovered where a BMP generated by OpenToonz contains inconsistent image-size fields. For a 1920×1080 8bit image, the file contains the correct 2,073,600 bytes of pixel data, but biSizeImage is recorded as only 518,400 bytes; exactly one quarter of the actual size. Consequently, bfSize is also recorded as 519,478 bytes even though the actual file size is 2,074,678 bytes.

This appears to be a separate pre-existing problem in OpenToonz’s 8bit grayscale BMP output or loading path.

Of note: While not extensively tested, 8bit grayscale BMP images rendered out of OT do appear to open in other programs. That may simply suggest those other programs have better fault tolerance.

Steps to Reproduce

(Using current releases of Opentoonz)

  • Create an drawing in OT and render as an 8bit grayscale BMP image.
  • Attempt to Load and/or Import the BMP into Opentoonz.
  • This should result in a crash.

All output from Opentoonz should be reloadable in Opentoonz. Rendering an 8bit grayscale BMP should produce valid image file.