TinyEXR.NET 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TinyEXR.NET --version 0.2.0                
NuGet\Install-Package TinyEXR.NET -Version 0.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TinyEXR.NET" Version="0.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TinyEXR.NET --version 0.2.0                
#r "nuget: TinyEXR.NET, 0.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TinyEXR.NET as a Cake Addin
#addin nuget:?package=TinyEXR.NET&version=0.2.0

// Install TinyEXR.NET as a Cake Tool
#tool nuget:?package=TinyEXR.NET&version=0.2.0                

TinyEXR.NET

TinyEXR.NET is a C# wrapper of single header-only C++ library tinyexr

tinyexr is a portable single header-only C++ library to load and save OpenEXR (.exr) images

The target framework of TinyEXR.NET is .NET Standard 2.1

Download

TinyEXR.NET can be found on NuGet NuGet (← click it !)

Supported Platforms

Key:

  • ✅: completed
  • 🚧: work in progress
  • ⌛: planned, not yet started
  • ❌: no plan
Platform State
Windows x64 🚧
Linux x64

Unlisted platforms are also unplanned.

But you can contribute to support any other platform! 😃

Usage

Simple read/write

TinyEXR.Exr.LoadFromFile("114514.exr", out var rgba, out int width, out int height);

float[] data = new float[1919 * 810 * 3];
TinyEXR.Exr.SaveToFile(data, 1919, 810, 3, false, "a.exr");

Read layer file

TinyEXR.Exr.LoadFromFileWithLayers("4396.exr", "777", out var rgba, out int width, out int height);

Read single part file

using var image = new TinyEXR.ExrImageReader("0721.exr");
var b = image.GetPixels(0);
var g = image.GetPixels(1);
var r = image.GetPixels(2);

Write scanline file

var save = new ExrImageWriter(3, image.Width, image.Height);
save.SetChannel(0, "B", b);
save.SetChannel(1, "G", g);
save.SetChannel(2, "R", r);
var result = save.WriteToFile("1551.exr");

Development build

TODO...

Details

I use CppSharp to generate binding code. Then write glue code by hand, because generated code are too heavy...

CppSharp does not generate struct defined by tinyexr. So, to make CppSharp happy, I separate the definition and implementation of tinyexr. It's too troublesome. Is there a simpler way?

License

TinyEXR.NET is under MIT license

and wrapped C++ lib tinyexr is under 3-clause BSD

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on TinyEXR.NET:

Package Downloads
ValveResourceFormat

Library to decompile Valve Source 2 files

UAI_ONNX

ONNX Runner built for C# projects that target .Net8.0 or later. This library is built on top of the ONNX Runtime C# API and provides a simple way to load and run ONNX models in C#.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on TinyEXR.NET:

Repository Stars
ValveResourceFormat/ValveResourceFormat
🔬 Valve's Source 2 resource file format parser, decompiler, and exporter.
Version Downloads Last updated
0.3.8 637 9/17/2024
0.3.7 511 8/4/2024
0.3.6 811 2/23/2024
0.3.5 364 8/7/2023
0.3.4 303 7/9/2023
0.3.3 180 6/6/2023
0.3.2 442 4/19/2023
0.3.1 222 4/4/2023
0.2.3 570 8/19/2022
0.2.2 400 8/16/2022
0.2.1 418 8/15/2022
0.2.0 406 8/14/2022
0.1.1 414 7/24/2022
0.1.0 422 7/15/2022
0.0.2-alpha.2 124 7/14/2022
0.0.2-alpha.1 109 7/14/2022

use cppsharp to generate interop code