Loading a user-edited texture at runtime without a brief freeze
I am very troubled! I am trying to implement an update to my game that allows my users to edit the textures on the characters easily, but there don't seem to be any ways to do it without causing a brief stall of the game. I'm hoping someone can help. I've tried so many things and none of them seem to work properly.
Use situation: the user presses a button to change a 2048x2048 texture on a character. I have around 130 different textures that are possible to load. The game is made with Unity 5.5.1
Problem: The textures for these characters are not user-accessible to be edited in a graphics editor unless they are stored as PNG or JPEG, which requires www.texture or www.loadimageintotexture to take them from where the user has them and put them in the game. Those functions freeze the game for a moment, though, so they're no good for a VR game.
What doesn't work: www.loadimageintotexture performs the task itself fine, but it causes the game to freeze for a moment so I can't use it.
Loading a compressed Texture file with Resources.loadasync or similar technique works fine for the textures, but the files are not accessible to the user because they're inside those .asset files. Editing a DXT5 texture with Gimp or Photoshop isn't really user friendly, either, even if the users could get into that file. They really need to be PNGs or JPEGs.
What I think I want: I can think of two things would probably solve this problem, but I'm afraid I don't know how to do either of them.
Way 1: Perform the task that www.loadimageintotexture does on a different thread, somehow. Decompressing a JPG/PNG and generating mip maps is too computationally heavy to do on the main thread, but if I could do it in the background it would work just fine.
Way 2: Load all the textures at startup using www, and then save them in a "Ready to go" DXT5 format like they would be in the Resources folder, or save them all as an asset bundle. That way all I would need to do is load them as I would a texture from an asset bundle/resources folder. I could ask the user if he or she changed the textures at startup, and then rebuild the assetbundle if the answer is yes.
Can either of those be done? Perhaps there's another way?