Skip to main content
.NETFramework4.8net6.0net8.0net9.0.NETStandard2.0

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

Published
Sep 21, 2026
29d ago
Total Downloads
4.6K
4,637

Install

dotnet add package JeremyAnsel.BcnSharp --version 1.0.10
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.

Changes from Previous Version

No structural changes between v1.0.9 and v1.0.10.

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.