Skip to content

Multithread/QoiSharp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QoiSharp
QoiSharp

Project status: active. What does it mean?

QoiSharp is an implementation of the QOI format for fast, lossless image compression

Supported functionality:

  • Encoding
  • Decoding
  • Encoder stream
  • Decoder stream
  • Unittests with 100% code coverage
  • Benchmarks

Installation

Install stable releases via Nuget

Package Name Release (NuGet)
QoiSharp NuGet

API

Encoding

Prefere the encoding stream to the byte array encoder for maximal performance

int width = 1920;
int height = 1080;
var channels = Channels.RgbWithAlpha;
var pixelStream = GetRawPixelStream();
Stream qoiDataStream = new QoiEncoderStream(pixelStream, new Size(width, height),channels);

byte[] data = GetRawPixels();
byte[] qoiData = QoiEncoder.Encode(new QoiImage(data, width, height, channels));

Decoding

Prefere the byte array decoder to the decoding stream for maximal performance, if you have the memory

var qoiImage = QoiDecoder.Decode(qoiData);
Console.WriteLine($"Width: {qoiImage.Width}");
Console.WriteLine($"Height: {qoiImage.Height}");
Console.WriteLine($"Channels: {qoiImage.Channels}");
Console.WriteLine($"Color space: {qoiImage.ColorSpace}");
Console.WriteLine($"Data length: {qoiImage.Pixels.Length}");

Stream decoderStream = new QoiDecoderStream(new MemoryStream(qoiImage));
Console.WriteLine($"Width: {decoderStream.Width}");
Console.WriteLine($"Height: {decoderStream.Height}");
Console.WriteLine($"Channels: {decoderStream.Channels}");
Console.WriteLine($"Color space: {decoderStream.ColorSpace}");

License

QoiSharp is licensed under the MIT license.

About

QoiSharp is an implementation of the QOI https://github.com/phoboslab/qoi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%