I have various image files which are compressed in such a way that they are far smaller then what unity is able to achieve. When I add them to the project, it tries to either use its own compression or I can pick a color depth. All of these options more then 2x my file. Is there some way I can tell unity to not touch this file and simply dump the bytes directly in the build? Can this be accomplished using the resources folder and perhaps renaming the images so it doesn’t know what they are? This would be a poor solution since they wouldn’t be visible in game.
If anyone has any thoughts I would love to hear them.
Thanks.
I have had success before with changing the extension of all the images to .txt so unity sees them as TextAssets and then loading the images using Texture2D.LoadImage. LoadImage takes in a byte array which you can get from the TextAsset.
The images are loaded at runtime though so you can not use them before then, depending on what need this might not be optimal. When they are loaded at runtime, they will then be of the much larger size because of the format and therefore take up more memory.
If you do need the images before runtime I recommend you to come to terms with the fact that Unitys compression will change the size of the files. Keeping in mind that power of 2 textures can be compressed better.