K0lb3 / UnityPy

UnityPy is python module that makes it possible to extract/unpack and edit Unity assets
MIT License
771 stars 114 forks source link

TextureFormat.ASTC_RGB_8x8 quality is slightly reduced. #188

Open Thura122016 opened 1 year ago

Thura122016 commented 1 year ago

Bug When I edit TextureFormat.ASTC_RGB_8x8, It changes the TextureFormat.ETC2_RGBA8 and the image quality is slightly reduced. Can you fix it or How can I?

K0lb3 commented 1 year ago

All texture compression algorithms employed by Unity are lossy. When replacing a texture, it either has to be stored as uncompressed type or has to be compressed again. Uncompressed increases the size of the asset by a lot (2~8x of the original image data size), while recompression creates a loss in quality.

You can set an uncompressed target texture type by using Texture2D.set_image. You can achieve no compression by using TextureFormat.RGBA32.