Skip to main content

A .Net library to encode and decode BCn BC3 BC5 BC7 texture compression formats.

Total Downloads
4.6K
4,637
Published
Oct 15, 2026
4d ago

Get Started

dotnet add package JeremyAnsel.BcnSharp --version 1.0.11
ProductVersions
.NET
net6.0net8.0net9.0
.NET Standard
netstandard2.0
Other
.NETFramework4.8

README

JeremyAnsel.BcnSharp

Build status NuGet Version License

JeremyAnsel.BcnSharp is a .Net library to encode and decode BCn BC3 BC5 BC7 texture compression formats.

Description Value
License The MIT License (MIT)
Documentation http://jeremyansel.github.io/JeremyAnsel.BcnSharp
Source code https://github.com/JeremyAnsel/JeremyAnsel.BcnSharp
Nuget https://www.nuget.org/packages/JeremyAnsel.BcnSharp
Build https://ci.appveyor.com/project/JeremyAnsel/jeremyansel-bcnsharp/branch/main

The JeremyAnsel.BcnSharp library is based on the bc7enc_rdo library. See https://github.com/richgel999/bc7enc_rdo

Usage

The methods to encode and decode textures are in these static classes: Bc7Sharp, Bc5Sharp, Bc3Sharp.

The methods are:

int GetEncodedArrayLength(int width, int height)
byte[] CreateEncodedArray(int width, int height)
void Encode(IntPtr pBlock, IntPtr pPixelsRGBA, int width, int height)
void Encode(byte[] pBlock, byte[] pPixelsRGBA, int width, int height)
byte[] Encode(byte[] pPixelsRGBA, int width, int height)
int GetDecodedArrayLength(int width, int height)
byte[] CreateDecodedArray(int width, int height)
void Decode(IntPtr pBlock, IntPtr pPixelsRGBA, int width, int height)
void Decode(byte[] pBlock, byte[] pPixelsRGBA, int width, int height)
byte[] Decode(byte[] pBlock, int width, int height)

The length of encoded array is

((width + 3) / 4) * ((height + 3) / 4) * 16

The length of decoded array is

width * height * 4

The encode and decode methods can create a new output array or can be called with an existing output array.

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 5 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.