smack0007 / ImageDotNet

Image library for reading and writing images in pure C#.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The MIT License Actions Status NuGet Badge

ImageDotNet

A library for loading and saving images in .NET.

Goals

The goal of the library is to serve a purpose similar to stb_image and stb_image_write except written in C#. The goals include:

  • Loading images.
  • Writing images.
  • Converting between different pixel formats.

Example

// Load image.png and ensure the pixel format is Rgba32.
var image = Image.LoadPng("image.png").To<Rgba32>();

// Get a pointer to the image data and pass it to glTexImage2D.
using (var data = image.GetDataPointer())
{
	glTexImage2D(GL_TEXTURE_2D, 0, (int)GL_RGBA, image.Width, image.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (void*)data.Pointer);
}

Credits

Thanks to:

About

Image library for reading and writing images in pure C#.

License:MIT License


Languages

Language:C# 99.7%Language:Batchfile 0.3%