- Home /
Dealing with massive amount of user generated images
I need to create a system where we load images into the game. Those images can be uploaded by the users of my app through a dashboard. I download them to the device(persistent data path) and load them from there. The question is, should I load them as AssetBundles(through Addressables) or straight from disk with Texture.LoadImage(bytes).
Keep in mind that I will not be able to apply custom compression for them. I use the same compression for all files, whether it's an asset bundle or not. The problem with asset bundles is the management of them. When you update the unity version + the fact that I need to have unity run on a server and create them every time someone uploads an image to the dashboard.
TL;DR; Is the loading of an image that bad with Texture.LoadImage(bytes) that you should use AssetBUndles even if it involves way more work and problems?
Answer by xxmariofer · Aug 05, 2020 at 12:42 PM
i dont know the requisites of your app, but have you consider a third option, using RawImages? if i am not incorrect, loading the rawimage should be way faster, something like this
using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(fullpath))
{
yield return uwr.SendWebRequest();
if (uwr.isNetworkError || uwr.isHttpError)
{
Debug.Log(uwr.error);
}
else
{
myRawImage.texture = DownloadHandlerTexture.GetContent(uwr);
}
}
Why is raw image faster? I need to cache the images locally, so I'll download them myself. Does UnityWebRequestTexture.GetTexture runs ok if I use persistent data path?
i have read the question fast and i though that when you were talking about image you were talking about "UnityEngine.UI.Image" and using RawImage is faster because doesnt convert texture to sprite, my bad, and yes UnityWebRequest is fine for persistentDataPath but i dont know if it will be fastee than Textures.Load
you read it correctly there. It is a UI Image
Your answer
![](https://koobas.hobune.stream/wayback/20220613004946im_/https://answers.unity.com/themes/thub/images/avi.jpg)