This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compressing ETC1 Texture with a library

I'm finding that ETC1 textures (.pkm) are taking a rather large amount of data up on my storage device. What options are there for further reducing the file size, such as compression with a third party like zlib, anyone know how to do that? Is there any other techniques to reduce the file size without compromising quality?

Parents
  • Depending on the device you're targeting you may be able to step up from ETC into ASTC, which has more options for better compression and higher visual fidelity.

    If you're stuck to ETC for legacy reasons zlib is an option, but you would need to link the library into your package and call it manually when loading textures. ETC is a lossy compression but it decompresses in hardware, whereas zlib is a lossless compression which you would need to spend CPU time decoding when the files are loaded at application start up (or during if textures are loaded on the fly). The way zlib works is by dictionary based redundancy, and ETC is designed for blocks of pixels to be independent so you would get best results if your image contained areas where multiple blocks look pretty much the same.

    You haven't said what platform you're working on. If it's android based the assets contained in the APK are compressed anyway, and may be getting unpacked into storage at load time. Depending on how much control you have over your asset pipeline (Assuming you're coding it yourself and not using a 3rd party library or an engine like Unity or Unreal) you could unpack assets one at a time, load them into the GPU, and then delete the unpacked files.

    If none of these techniques are right for you, you could also look into your actual usage of textures. For example, do you need them to have such a high resolution? examining the screen space filled by these textures, you may find that they contain more information than is needed. Without seeing the application or the assets I can't really advise any further.

Reply
  • Depending on the device you're targeting you may be able to step up from ETC into ASTC, which has more options for better compression and higher visual fidelity.

    If you're stuck to ETC for legacy reasons zlib is an option, but you would need to link the library into your package and call it manually when loading textures. ETC is a lossy compression but it decompresses in hardware, whereas zlib is a lossless compression which you would need to spend CPU time decoding when the files are loaded at application start up (or during if textures are loaded on the fly). The way zlib works is by dictionary based redundancy, and ETC is designed for blocks of pixels to be independent so you would get best results if your image contained areas where multiple blocks look pretty much the same.

    You haven't said what platform you're working on. If it's android based the assets contained in the APK are compressed anyway, and may be getting unpacked into storage at load time. Depending on how much control you have over your asset pipeline (Assuming you're coding it yourself and not using a 3rd party library or an engine like Unity or Unreal) you could unpack assets one at a time, load them into the GPU, and then delete the unpacked files.

    If none of these techniques are right for you, you could also look into your actual usage of textures. For example, do you need them to have such a high resolution? examining the screen space filled by these textures, you may find that they contain more information than is needed. Without seeing the application or the assets I can't really advise any further.

Children