saveFile for saving in bmp format


I tried to use the saveFile API to save using bmp file but it saves as pvr format. Is bmp format supported to use with saveFile API of PVRTexLib?

The steps i did is creating CPVRTextureHeader and then CPVRTexture using the header and data. Then i tried to call saveFile.

Please guide.


Hi Anoop,

I talked with one of our engineers about this and what he had to say was that essentially, PVRTexLib handles textures, not images.

To create a texture from an image file (PNG, BMP, JPEG etc.), you need to load the data yourself and put it into a PVRTexture object. You can then manipulate the texture, transcode it etc. and save it out to a pvr, ktx or dds file (which are texture formats).

To save a texture into an image file, you need to make sure it has been transcoded to a format that the image file type supports, such as R8G8B8. Then you can extract the data from the surface you want (textures support cube maps, 3d textures, texture arrays etc.) and write it to disk as the image file of your choice.

Put simply, PVRTexLib can save to and load from PVR, KTX and DDS texture formats. For image formats, you need to do this manually, or use the PVRTexToolCLI/PVRTexToolGUI.