Restoring Texture After DXT Compression
Jump to navigation
Jump to search
VTF Textures saved in a compressed DXT format suffer irreversible data loss. If the source files for the texture are unavailable, the only choice is to use the compressed texture which can be problematic due to the blocky artifacts and green tint from the compression. If this is used for further edits and then re-compressed, the quality loss will get even greater.
The effects of the DXT can now be reversed by the use of an AI neural network model, which has been specifically trained on images in their original format versus their DXT-compressed version. The results are effective on cartoony textures and remove most of the blocky artefacts, although fine-grain detail on more realistic textures will be smoothed out.
Note:The AI can only work off information already present in the image, hence the results will never be the same as the original source file. It is only an approximation.
Warning:DXT textures with fine-grain detail, such as rock or sand, will be smoothed out if cleaned up.
Steps
Warning:The model linked in this tutorial is trained on textures that have had green tint introduced due to improper decompression algorithms used by older DXT decoders. Running an image that has been properly decoded (using a tool like VTFEdit Reloaded or Vtex2) will result in a minor hue shift.
- Download CupScale and follow the install instructions here. Note:Make sure you have Python 3.9 installed rather than any newer version, as only that specific version will work.Warning:If you don't have all dependencies installed as listed in CupScale's dependency checker, attempting to modify the image will confusingly cause the process to immediately cancel.
- Download the AI model from here and assign the model to CupScale (underneath
ESRGAN Model Options
). - Export your compressed texture into .png format and drag it onto CupScale's area.
- Run the AI by pressing the
Upscale and Save
button. This might take a while depending on how powerful your GPU is and the image resolution. - The new decompressed image will be available beside your original image.