A simple Python wrapper for NVTT3 (NVIDIA Texture Tools 3)
Project description
pyNVTT
About
A simple Python Wrapper for NVTT3 library, useful to convert most relevant images formats to DDS while doing modding or game development.
Installation
pip install pynvtt
Examples
Minimal PNG to DDS conversion.
from nvtt.surface import Surface
from nvtt.compression import CompressionOptions
from nvtt.output import OutputOptions
from nvtt.context import Context
surface = Surface("texture_01.png")
compression = CompressionOptions()
output = OutputOptions()
output.filename("texture_01.dds")
ctx = Context()
ctx.compress_all(surface, compression, output)
You can also use the EasyDDS class for your convenience.
from nvtt.easy_dds import EasyDDS
EasyDDS.convert_img("texture_01.png")
This will create a DXT1 DDS with default mipmap generation with the same name in the same path.
Converting a Pillow image.
from nvtt.surface import Surface
from nvtt.compression import CompressionOptions
from nvtt.output import OutputOptions
from nvtt.context import Context
from nvtt.enums import Format
from PIL import Image
img_surface = Surface(Image.open("texture_01.png"))
compression = CompressionOptions()
compression.format(Format.DXT1)
output = OutputOptions()
output.filename("texture_01.dds")
ctx = Context()
ctx.compress_all(img_surface, compression, output)
This will create a DXT1 DDS with default mipmap generation.
Features
- NVTT 3.2.5 (with FreeImage 3.19.0.0)
- Multiple formats support (Mostly every format supported by FreeImage):
.png.tga.webp.jpg/.jpeg.bmp.tiff/.tif.gif.hdr.dds.psd
- Partial API support:
Includes
Surface,Context,OutputOptions, andCompressionOptions. - Mipmap level detection, minimum level and no mipmaps.
- Every DDS format supported (
DXT1,DXT5,BC7, etc.) - CUDA Acceleration support.
License
Distributed under the CC0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynvtt-0.0.2.tar.gz.
File metadata
- Download URL: pynvtt-0.0.2.tar.gz
- Upload date:
- Size: 48.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e468bbc38501064c80d30cc2512832d07dfe0e8d9621061468e90c150ae524db
|
|
| MD5 |
f27028cd0c7a78add4432379b49ef078
|
|
| BLAKE2b-256 |
033d8261c1be6c314cc4af96f2bdb0b6c0188b7fcc9197259411a8af4a01791b
|
File details
Details for the file pynvtt-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pynvtt-0.0.2-py3-none-any.whl
- Upload date:
- Size: 48.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0572fe513bffeca73ce4d3aa5330362e4e9bde1699da6ca14270a7d0624894ca
|
|
| MD5 |
d974b8bff9bb954b6667e85d378b9a87
|
|
| BLAKE2b-256 |
4dc032004069c4bab4654faa54936fb88a79ed9fc8aa8e72dd77ae86c6e97d97
|