Skip to content

Resolve "16 bit PNG images are stored as big endian"

Closes #21 (closed)

I have added functionality to read and write 16 bit PNG images correctly. 16 bit PNG images are stored as big-endian, but before we were writing them as little-endian. This PR fixes that.

This fix also includes a generic way of loading in one data type (e.g., uint_16) and automatically converting it into another data type (e.g., using uint8_t). Conversion is done such that pixel values are automatically scaled (in contrast to casting, which would cut off the MSB).

@andre.anjos I assign this PR to you since you have written the IO libraries.

Merge request reports