My image is a 24-bit BMP texture. Is there a way I can load it with 24-bit precision?
As far as I know, BMP does not support high dynamic range/higher precision than 8 bpc. A 24-bit BMP image is just a RGB8 image (with no alpha channel).
If you need to import high dynamic range images, use the Radiance HDR (.hdr
) or OpenEXR (.exr
) format. While both are perfectly functional for HDR images, OpenEXR has better compression and is more modern overall. Godot can also load and save OpenEXR images at run-time using the Image class.
Edit: Run-time OpenEXR loading and saving is only available in editor builds, see below.
Note that Godot will clamp PNG precision to 8 bpc, so PNGs that were saved with 16 bpc will be clamped to 8 bpc. This is done because many people aren't aware that they are saving PNGs with a higher color depth than 8 bpc, and end up wasting lots of disk space and memory in the end. This is why we chose to make the HDR decision explicit by using formats specifically tailored for HDR, rather than relying on PNG for this purpose.