Metadata-Version: 2.4
Name: texconv-py
Version: 1.0
Summary: A lightweight Python wrapper around Microsoft's Texconv (DirectXTex)
Author: DarkWolf197
License: MIT License
        
        Copyright (c) 2026 DarkWolf197
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/DarkWolf197/texconv-py
Project-URL: Repository, https://github.com/DarkWolf197/texconv-py
Keywords: texconv,directxtex,dds,texture,wrapper
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Texconv-Py
A lightweight Python wrapper around Microsoft's Texconv (DirectXTex).

## Features
- Type hints for every setting and flag
- Checks for conflicting options

## Requirements
- `texconv.exe` (Windows) — download from [DirectXTex releases](https://github.com/Microsoft/DirectXTex/releases/latest/download/texconv.exe)

## Installation
```bash
pip install texconv-py
```

## Usage

#### Converting a DXT5 Normal Map
```python
from pathlib import Path
from texconv import Texconv, FileOptions, ImageOptions, NormalMapOptions, FormatOptions, Format

TEXCONV = Path(r"path\to\Texconv.exe")

# Creating the Texconv instance
fix_nmap_dxt5 = Texconv(TEXCONV, 
        FileOptions(
            output=Path(r"path\to\output\folder"),
            overwrite=True),
        ImageOptions(swizzle="ga11"),
        NormalMapOptions(invert_y=True, reconstruct_z=True),
        FormatOptions(format=Format.DXGI_FORMAT_BC1_UNORM)
        )

# Using a list of Path (or strings)
nmaps = [
    Path(r"path\to\tex1_n.dds"),
    Path(r"path\to\tex42_n.dds"),
    Path(r"path\to\tex10_n.dds"),
    Path(r"path\to\test_n.dds")
]

# Running Texconv
fix_nmap_dxt5.run(nmaps)
```
#### Performing various changes to images using a text file for the paths
```python
from pathlib import Path
from texconv import Texconv, FileOptions, ImageOptions, FileType, FormatOptions

TEXCONV = Path(r"path\to\Texconv.exe")

Texconv(TEXCONV, 
    FileOptions(
        output=Path(r"path\to\output\folder"),
        overwrite=True,
        to_lowercase=True,
        prefix='pre_'),
    ImageOptions(horizontal_flip=True),
    FormatOptions(file_type=FileType.PNG)
).run(r"path\to\textures.txt", file_list=True)
```


## License

MIT License — see [LICENSE](LICENSE) for details.
