StbiSharp 1.0.1

There is a newer version of this package available.
See the version list below for details.
Install-Package StbiSharp -Version 1.0.1
dotnet add package StbiSharp --version 1.0.1
<PackageReference Include="StbiSharp" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StbiSharp --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: StbiSharp, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install StbiSharp as a Cake Addin
#addin nuget:?package=StbiSharp&version=1.0.1

// Install StbiSharp as a Cake Tool
#tool nuget:?package=StbiSharp&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

StbiSharp

A C# wrapper around the single-header image-loading library stb_image.h. It supports JPEG, PNG, BMP, GIF, HDR, PIC, PNM, PSD, and TGA (for some formats only a subset of features; consult stb_image.h for details).

You can find the source code of this package on GitHub.

Usage

Grab StbiSharp from nuget, then load an image as follows:

public void doSomethingWithImage()
{
    using (var stream = File.OpenRead("some-image.jpg"))
    using (var memoryStream = new MemoryStream())
    {
        stream.CopyTo(memoryStream);
        StbiImage image = Stbi.LoadFromMemory(memoryStream, 4);

        // Use image.Width, image.Height,
        // image.NumChannels, and image.Data.
    }
}

If the encoded image is directly available in memory, no file stream needs to be used.

License

StbiSharp is available under the BSD 3-clause license. TL;DR you can do almost whatever you want as long as you include the original copyright and license notice in any copy of the software and the source code.

  • .NETStandard 2.1

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on StbiSharp:

Package Downloads
ppy.osu.Framework

A 2D application/game framework written with rhythm games in mind.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on StbiSharp:

Repository Stars
ppy/osu-framework
A game framework written with osu! in mind.
Version Downloads Last updated
1.0.13 211,608 11/6/2020
1.0.12 30,364 6/24/2020
1.0.11 42,857 12/17/2019
1.0.10 3,445 11/29/2019
1.0.9 286 11/29/2019
1.0.8 1,220 11/21/2019
1.0.7 237 11/19/2019
1.0.6 222 11/19/2019
1.0.4 231 11/17/2019
1.0.3 237 11/17/2019
1.0.2 229 11/17/2019
1.0.1 253 11/17/2019

Automated release.