BasisUniversal.NET 1.0.0-preview.1

This is a prerelease version of BasisUniversal.NET.
There is a newer version of this package available.
See the version list below for details.
dotnet add package BasisUniversal.NET --version 1.0.0-preview.1
                    
NuGet\Install-Package BasisUniversal.NET -Version 1.0.0-preview.1
                    
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="BasisUniversal.NET" Version="1.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BasisUniversal.NET" Version="1.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="BasisUniversal.NET" />
                    
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 BasisUniversal.NET --version 1.0.0-preview.1
                    
#r "nuget: BasisUniversal.NET, 1.0.0-preview.1"
                    
#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 BasisUniversal.NET@1.0.0-preview.1
                    
#: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=BasisUniversal.NET&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BasisUniversal.NET&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Tool

BasisUniversal.NET

BasisUniversal.NET is a thin .NET wrapper around Binomial's Basis Universal GPU texture codec. It exposes the upstream encoder/transcoder C API without taking a dependency on any higher-level texture library.

This package is currently an early preview. Native runtime binaries are not yet fully distributed for every target platform, so users may need to build the native shim themselves and place the output in the matching NuGet runtime asset folder.

The package is intended to be used directly by tools, asset pipelines, and adapter packages such as TextureCompressor.BasisUniversal.

Current Scope

  • Encode RGBA32 pixels to .ktx2 or .basis payloads.
  • Inspect Basis-compressed KTX2 metadata.
  • Transcode KTX2 image levels to Basis Universal's supported target formats, including RGBA32, ETC, BC1-5, BC7, PVRTC, ATC, FXT1, and ASTC targets where the source Basis texture format supports them.
  • Native library distribution is still being finalized. For now, expect to compile the native shim yourself for your target runtime ID.

Example

using BasisUniversal;

byte[] rgba32 = LoadRgba32Pixels();

byte[] ktx2 = BasisUniversalCodec.EncodeKtx2(
    rgba32,
    width: 1024,
    height: 1024,
    new BasisEncoderOptions
    {
        Format = BasisTextureFormat.UastcLdr4x4,
        QualityLevel = 50,
        EffortLevel = 2
    });

using var texture = BasisKtx2Texture.Open(ktx2);
TranscodedImage bc7 = texture.TranscodeImageLevel(TranscoderTextureFormat.Bc7Rgba);

Native Build

The native shim uses CMake and pins BinomialLLC/basis_universal to v2_1_0r (e4f439fc9545b6a9e1fd26fc7ffd0c682c4b96d4).

cmake -S native -B native/build -DCMAKE_BUILD_TYPE=Release
cmake --build native/build --config Release --target basisu_net

Copy the produced native library into the matching NuGet runtime asset folder, for example:

cp native/build/out/libbasisu_net.dylib runtimes/osx-arm64/native/

Then run:

dotnet test BasisUniversal.NET.slnx
dotnet pack src/BasisUniversal.NET/BasisUniversal.NET.csproj -c Release

Licensing

This wrapper package uses the Apache-2.0 license. The native implementation is built from BinomialLLC/basis_universal, which is also Apache-2.0. See THIRD-PARTY-NOTICES.md for upstream notice details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on BasisUniversal.NET:

Package Downloads
TextureCompressor.Codecs.BasisUniversal

Basis Universal adapter for TextureCompressor texture encoding.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 108 6/2/2026
1.0.0-preview.3 73 5/23/2026
1.0.0-preview.2 61 5/22/2026
1.0.0-preview.1 53 5/21/2026