All Projects → Nominom → Bcnencoder.net

Nominom / Bcnencoder.net

Licence: other
Cross-platform texture encoding libary for .NET. With support for BC1-3/DXT, BC4-5/RGTC and BC7/BPTC compression. Outputs files in ktx or dds formats.

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Bcnencoder.net

Torch Encoding Layer
Deep Texture Encoding Network
Stars: ✭ 80 (+185.71%)
Mutual labels:  encoding, texture
Cyberchef
The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis
Stars: ✭ 13,674 (+48735.71%)
Mutual labels:  encoding, compression
Libbrotli
meta project to build libraries from the brotli source code
Stars: ✭ 110 (+292.86%)
Mutual labels:  encoding, compression
Qs
Quick serialization of R objects
Stars: ✭ 225 (+703.57%)
Mutual labels:  encoding, compression
Lerc
Limited Error Raster Compression
Stars: ✭ 126 (+350%)
Mutual labels:  encoding, compression
Turbopfor Integer Compression
Fastest Integer Compression
Stars: ✭ 520 (+1757.14%)
Mutual labels:  encoding, compression
Peazip
Free Zip / Unzip software and Rar file extractor. Cross-platform file and archive manager. Features volume spanning, compression, authenticated encryption. Supports 7Z, 7-Zip sfx, ACE, ARJ, Brotli, BZ2, CAB, CHM, CPIO, DEB, GZ, ISO, JAR, LHA/LZH, NSIS, OOo, PAQ/LPAQ, PEA, QUAD, RAR, RPM, split, TAR, Z, ZIP, ZIPX, Zstandard.
Stars: ✭ 827 (+2853.57%)
Mutual labels:  compression
Scn
Scale-wise Convolution for Image Restoration
Stars: ✭ 26 (-7.14%)
Mutual labels:  compression
Anycodable
Type-erased wrappers for Encodable, Decodable, and Codable values
Stars: ✭ 811 (+2796.43%)
Mutual labels:  encoding
Gan Compression
[CVPR 2020] GAN Compression: Efficient Architectures for Interactive Conditional GANs
Stars: ✭ 800 (+2757.14%)
Mutual labels:  compression
Gli
jvm gli
Stars: ✭ 21 (-25%)
Mutual labels:  texture
Srec
PyTorch Implementation of "Lossless Image Compression through Super-Resolution"
Stars: ✭ 868 (+3000%)
Mutual labels:  compression
Compressed Vec
SIMD Floating point and integer compressed vector library
Stars: ✭ 25 (-10.71%)
Mutual labels:  compression
Borgmatic
Simple, configuration-driven backup software for servers and workstations
Stars: ✭ 902 (+3121.43%)
Mutual labels:  compression
Nippy
High-performance serialization library for Clojure
Stars: ✭ 838 (+2892.86%)
Mutual labels:  compression
Zlib Ng
zlib replacement with optimizations for "next generation" systems.
Stars: ✭ 807 (+2782.14%)
Mutual labels:  compression
Drv3 Tools
(Not actively maintained, use DRV3-Sharp) Tools for extracting and re-injecting files for Danganronpa V3 for PC.
Stars: ✭ 13 (-53.57%)
Mutual labels:  compression
Android 3d Model Viewer
Android OpenGL 2.0 application to view 3D models. Published on Play Store
Stars: ✭ 809 (+2789.29%)
Mutual labels:  texture
Blosc.jl
Blosc compression for the Julia language
Stars: ✭ 24 (-14.29%)
Mutual labels:  compression
Lib
single header libraries for C/C++
Stars: ✭ 866 (+2992.86%)
Mutual labels:  compression

Nuget Tests

BCnEncoder.NET

A Cross-platform BCn / DXT encoding libary for .NET

What is it?

BCnEncoder.NET is a library for compressing rgba images to different block-compressed formats. It has no native dependencies and is .NET Standard 2.1 compatible.

Supported formats are:

  • Raw unsigned byte R, RG, RGB and RGBA formats
  • BC1 (S3TC DXT1)
  • BC2 (S3TC DXT3)
  • BC3 (S3TC DXT5)
  • BC4 (RGTC1)
  • BC5 (RGTC2)
  • BC7 (BPTC)

Current state

The current state of this library is in development but quite usable. I'm planning on implementing support for more codecs and different algorithms. The current version is capable of encoding and decoding BC1-BC5 and BC7 images in both KTX or DDS formats.

Please note, that the API might change between versions.

Dependencies

Current dependencies are:

Image library extensions

This library has extension packages available for the following image libraries:

ImageSharp

The extension packages provide extension methods for ease of use with the image library.

Upgrading to 2.0

If you're upgrading from 1.X.X to version 2, expect some of your exsting code to be broken. ImageSharp was removed as a core dependency in version 2.0, so the code will no longer work with ImageSharp's Image types by default. You can install the extension package for ImageSharp to continue using this library easily with ImageSharp apis.

API

This below examples are using the ImageSharp extension package. For more detailed usage examples, you can go look at the unit tests.

Here's an example on how to encode a png image to BC1 without alpha, and save it to a file.

using Image<Rgba32> image = Image.Load<Rgba32>("example.png");

BcEncoder encoder = new BcEncoder();

encoder.OutputOptions.GenerateMipMaps = true;
encoder.OutputOptions.Quality = CompressionQuality.Balanced;
encoder.OutputOptions.Format = CompressionFormat.Bc1;
encoder.OutputOptions.FileFormat = OutputFileFormat.Ktx; //Change to Dds for a dds file.

using FileStream fs = File.OpenWrite("example.ktx");
encoder.EncodeToStream(image, fs);

And how to decode a compressed image from a KTX file and save it to png format.

using FileStream fs = File.OpenRead("compressed_bc1.ktx");

BcDecoder decoder = new BcDecoder();
using Image<Rgba32> image = decoder.DecodeToImageRgba32(fs);

using FileStream outFs = File.OpenWrite("decoding_test_bc1.png");
image.SaveAsPng(outFs);

TO-DO

  • [x] BC1 / DXT1 Encoding Without Alpha
  • [x] BC1 / DXT1 Encoding With 1bit of alpha
  • [x] BC2 / DXT3 Encoding
  • [x] BC3 / DXT5 Encoding
  • [x] BC4 Encoding
  • [x] BC5 Encoding
  • [x] BC7 / BPTC Encoding
  • [x] DDS file support
  • [x] Implement PCA to remove Accord.Statistics dependency
  • [ ] BC6H HDR Encoding
  • [ ] ETC / ETC2 Encoding?

Contributing

All contributions are welcome. I'll try to respond to bug reports and feature requests as fast as possible, but you can also fix things yourself and submit a pull request. Please note, that by submitting a pull request you accept that your code will be dual licensed under MIT and public domain Unlicense.

License

This library is dual-licensed under the Unlicense and MIT licenses.

You may use this code under the terms of either license.

Please note, that any dependencies of this project are licensed under their own respective licenses.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].