See https://github.com/KhronosGroup/Universal-Texture-Transcoders/pull/13#discussion_r501168337 as a starting point.