GtfDdsSharp 1.0.0

dotnet add package GtfDdsSharp --version 1.0.0
                    
NuGet\Install-Package GtfDdsSharp -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GtfDdsSharp" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GtfDdsSharp" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="GtfDdsSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GtfDdsSharp --version 1.0.0
                    
#r "nuget: GtfDdsSharp, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GtfDdsSharp@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GtfDdsSharp&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=GtfDdsSharp&version=1.0.0
                    
Install as a Cake Tool

GtfDdsSharp

Build NuGet

A .NET library to convert GTF files to and from DDS files.

Background

Graphics Texture Format (GTF) and DirectDraw Surface (DDS) are file formats for storing one or more textures, often used in video game development. GTF files are used by PS3 games whereas DDS files are often seen in PC games.

Installation

This project is available as a NuGet package.

dotnet add package GtfDdsSharp

Usage

See documentation for API reference, samples, and tutorials.

Code Samples

There are several ways to convert between file formats, including both file system and in-memory conversion.

Convert a GTF file to a DDS file:

GtfImage.ConvertToDds(gtfPath, ddsPath);

Convert a DDS file to a GTF file:

DdsImage.ConvertToGtf(ddsPath, gtfPath);

Convert a GTF file to a DDS file in-memory:

// Read the GTF file into memory.
byte[] gtfBytes = File.ReadAllBytes(gtfPath);
using GtfImage image = new(gtfBytes);

// Convert the first texture to a DDS file.
GtfTexture texture = image[0];
byte[] ddsBytes = new byte[texture.DdsFileSize];
texture.ConvertToDds(ddsBytes);

Convert a DDS file to a GTF file in-memory:

// Read the DDS file into memory.
byte[] ddsBytes = File.ReadAllBytes(ddsPath);
using DdsImage image = new(ddsBytes);

// Convert the image to a GTF file.
byte[] gtfBytes = new byte[image.GtfFileSize];
image.ConvertToGtf(gtfBytes);

References

  • Ported from samples/util/gtf/libgtfconv, a C++ library included in the PS3 SDK.
  • DDS test data from Pfim, created by Nick Babcock.
  • Icon by Freepik.
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 207 11/6/2025