/oss · 2 merged

zigimg/zigimg

A Zig library for reading and writing image files such as PNG, BMP and JPEG.

the project on GitHub (opens in a new tab)
  1. 15 Oct 2026

    24-bit BMP images of any width save and load correctly

    What was broken
    BMP files need each row padded to a multiple of 4 bytes. The library skipped that, so images of other widths saved as broken files and loaded skewed.
    What I changed
    I made it add the padding when saving and skip it when loading.
    Why it matters
    Images of any width now go in and out of BMP files intact.

    see the code, #347 (opens in a new tab)

  2. 15 Oct 2026

    32-bit BMP images save with the right colors

    What was broken
    Saving a 32-bit image as a BMP file wrote a header that did not match the pixel order. Some programs refused the file and others showed the colors swapped.
    What I changed
    I made the header describe the pixels in the order they are actually written.
    Why it matters
    BMP files saved by the library open correctly in other programs.

    see the code, #346 (opens in a new tab)

← every project