Restoring Texture After DXT Compression

From Valve Developer Community
Jump to: navigation, search
Original compressed texture versus the decompressed texture via the AI.
(Click to see full size)

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 and remove most of the blocky artifacts and the green tint.

Note.png 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.

Steps

  1. Download CupScale and follow the install instructions here.
    Note.png Note: Make sure you have Python 3.9 installed rather than any newer version, as only that specific version will work.
    Warning.png 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.
  2. Download the AI model from here and assign the model to CupScale (underneath ESGRAN Model Options).
  3. Export your compressed texture into .png format and drag it onto CupScale's area.
  4. 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.
  5. The new decompressed image will be available beside your original image.

See Also