lmachens / d4-texture-extractor

Extracts and converts Diablo 4 .tex files to png, webp or jpg. Also slices the files into separate images when applicable.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Diablo 4 Texture Extractor

What it does

The Diablo 4 Texture Extractor is a tool that extracts and converts .tex files to PNG, WebP, or JPG formats. It can also slice the files into separate image files when applicable.

Known Issues

  • Some of the intermediate DDS files might not be valid, which can cause texconv to fail.

Installation

  1. Clone this repository by following the instructions in the GitHub documentation.
  2. Download the latest CASCConsole.zip from https://github.com/WoW-Tools/CASCExplorer/releases.
  3. Extract the contents of the CASCConsole.zip into the CASCConsole folder under d4-texture-extractor folder. CASCConsole.exe and the other files from the zip file should be in the same folder with extract_cascconsole.exe_and_other_files_here
  4. Run npm install in d4-texture-extractor folder. You should have at least latest LTS version of NodeJS installed.

Usage

Usage: node ./index.js [options]
All options are optional

Options:
  -e, --extract                Automatically extract game files before processing (this will delete previously extracted files)
  -g, --gameFolder <path>      Path to Diablo IV folder, for example "C:\Program Files (x86)\Diablo IV\"
  -c, --concurrency <number>   number of concurrent tasks
  -o, --outputformat <format>  png, jpg or webp
  -p, --outputpath <path>      Full or relative path to output folder, default is './{outputformat}'
  -f, --filter <wildcard>      Wildcard to filter files to process, for example '2DUI*', no need to include .json extension, default is '*'
  -nc, --nocrop                Do not crop images to the size of the texture, useful for map textures
  -ns, --noslice               Do not slice the images, useful for map textures
  -nsf, --noslicefolders       Do not use slice folders, instead save slicers to the output folder, prefixed with the file name
  -h, --help                   display help for command

You can find the full list of texture file names here

Example 1: Extract and convert all texture files starting with 2D into webp folder in webp format.

node .\index.js -f 2D* -c 10 -o webp -g "C:\Program Files (x86)\Diablo IV" -e

Example 2: Convert previously extracted files starting with zmap in webp format without cropping and slicing.

node .\index.js -f zmap* -c 10 -o webp -nc -ns

Credits and thanks

And finally to ChatGPT for doing half of the work for me. :)

About

Extracts and converts Diablo 4 .tex files to png, webp or jpg. Also slices the files into separate images when applicable.

License:MIT License


Languages

Language:JavaScript 100.0%