TinyEXR.NET 1.0.0-rc1

This is a prerelease version of TinyEXR.NET.
There is a newer version of this package available.
See the version list below for details.
dotnet add package TinyEXR.NET --version 1.0.0-rc1
                    
NuGet\Install-Package TinyEXR.NET -Version 1.0.0-rc1
                    
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="1.0.0-rc1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TinyEXR.NET" Version="1.0.0-rc1" />
                    
Directory.Packages.props
<PackageReference Include="TinyEXR.NET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TinyEXR.NET --version 1.0.0-rc1
                    
#r "nuget: TinyEXR.NET, 1.0.0-rc1"
                    
#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.
#:package TinyEXR.NET@1.0.0-rc1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TinyEXR.NET&version=1.0.0-rc1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TinyEXR.NET&version=1.0.0-rc1&prerelease
                    
Install as a Cake Tool

TinyEXR.NET

Test

TinyEXR.NET is a pure C# port library of tinyexr

The target frameworks are net8.0, netstandard2.1

Download

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

Dependencies

The net8.0 target has no additional runtime dependencies.

The netstandard2.1 target depends on SharpZipLib.

Features

  • full NativeAOT support!
  • Single-part EXR read/write for scanline images.
  • Single-part EXR read/write for tiled images, including one-level tiles and multi-resolution mipmap/ripmap layouts.
  • Multipart image EXR parse/load/save for image parts.
  • Deep single-part scanline EXR load through LoadDeepEXR.
  • Regular image compression support for NONE, RLE, ZIP, ZIPS, PIZ, PXR24, B44, and B44A.
  • Deep scanline compression support for NONE, RLE, ZIPS, and ZIP.
  • Layer- and multiview-aware helpers such as EXRLayers and LoadEXRWithLayer, including RGBA expansion for subsampled channels in the convenience load path.
  • Managed header/image models that preserve EXR metadata needed by tools and inspectors, including data/display windows, tile descriptions, custom attributes, channel sampling, line order, and long names.
  • Full image decode for mixed multipart files that include deep or non-image parts. Current behavior is metadata-only for those parts.

Usage

TinyEXR.NET keeps its public API almost identical to tinyexr v1, so most functions and data structures can be mapped directly from the original library. The main differences are a small number of C#-oriented interfaces designed to avoid raw pointer-based usage and provide a more natural managed API surface.

Example:

ResultCode load = Exr.LoadEXR(inputPath, out float[] rgba, out int width, out int height);
if (load != ResultCode.Success)
{
    throw new InvalidOperationException($"LoadEXR failed: {load}");
}

Samples

The repository currently includes TinyEXR.Viewer, an Avalonia sample built on top of TinyEXR.NET.

The viewer is intended for manual EXR inspection: it can open EXR files from the file picker, drag and drop, or a command-line path, preview single-part images and pure-image multipart files, switch between parts/layers/levels when decoded image data is available, and display metadata such as version flags, windows, tile information, channels, custom attributes, and deep-image statistics.

See Samples/TinyEXR.Viewer/README.md for run instructions and the current feature boundaries.

Test

The current test suite covers the main supported surface of the library across both target outputs: the default target path and the netstandard2.1 fallback path run the same shared test cases.

See Test/README.md for the current test layout and execution details.

Benchmark

The repository includes memory-only benchmarks for the main read/write paths. Sample files are loaded during setup, so the timed results reflect decode/encode work on in-memory buffers rather than filesystem IO.

  • CPU: Intel Core i7-11700F
  • OS: Windows 10 22H2 19045.6456
  • .NET runtime: 10.0.6
  • C++ compiler: MSVC 19.50.35729.0
Method Sample C# C++ baseline Managed / baseline
LoadEXRFromMemory desk_scanline 92.92 ms 54.69 ms 1.70x
SaveEXRToMemory desk_scanline 137.40 ms 197.92 ms 0.69x
LoadEXRImageFromMemory desk_scanline 70.72 ms 44.79 ms 1.58x
SaveEXRImageToMemory desk_scanline 56.68 ms 51.14 ms 1.11x
LoadEXRImageFromMemory kapaa_multires 60.03 ms 72.92 ms 0.82x
SaveEXRImageToMemory kapaa_multires 215.38 ms 273.44 ms 0.79x
LoadEXRMultipartImageFromMemory beachball_multipart_0001 112.6 ms 171.88 ms 0.66x
SaveEXRMultipartImageToMemory beachball_multipart_0001 276.3 ms 289.06 ms 0.96x
LoadDeepImageFromMemory balls_deep_scanline 21.05 ms N/A N/A

See Benchmark/README.md for more details.

Versioning

Starting with v1.0, TinyEXR.NET is a pure C# implementation of the tinyexr-compatible API surface.

The legacy v0.3.x line is kept as a maintenance branch. It may continue to receive compatibility fixes and follow tinyexr updates when needed, but no new features will be added to v0.3.x.

The main branch moves forward with v1.0+.

For new development, prefer the mainline v1.0+ branch. Use the v0.3.x maintenance branch only if you need the legacy native-wrapper line for compatibility reasons.

Upgrade from v0.3.x

  • High-level RGBA helpers such as LoadEXR, LoadEXRFromMemory, SaveEXR, SaveEXRToMemory, LoadEXRWithLayer, and EXRLayers are still the recommended entry points, so code that only uses these helpers usually needs little or no change.
  • IsExr and IsExrFromMemory are now IsEXR and IsEXRFromMemory.
  • TinyEXR.Native.* and TinyEXR.Native.EXRNative are gone. The library is now a pure managed C# implementation, so the old native-runtime, P/Invoke, and static-link workflow from v0.3.x no longer applies.
  • Native-style structs are replaced by managed types such as ExrVersion, ExrHeader, ExrImage, ExrMultipartHeader, ExrMultipartImage, ExrDeepImage, and ExrBox2i.
  • Low-level read/write calls are now managed out-based APIs instead of ref-based native mutation. For example, ParseEXRHeaderFromFile(path, ref version, ref header) becomes ParseEXRHeaderFromFile(path, out ExrVersion version, out ExrHeader header), and LoadEXRImageFromFile(ref image, ref header, path) becomes LoadEXRImageFromFile(path, header, out ExrImage image).
  • SaveEXRImageToMemory also changed shape: v0.3.x returned byte[]?, while the current API returns ResultCode and writes the payload to out byte[] encoded.

License

TinyEXR.NET is under MIT license

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 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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

  • net8.0

    • No dependencies.

NuGet packages (3)

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

Package Downloads
ValveResourceFormat

Parser, decompiler, and exporter for Valve's Source 2 resource file formats. Supports models, textures, materials, maps, particles, and more.

Aardvark.GeoSpatial.Opc

Aardvark.GeoSpatial.Opc formerly known as Aardvark.VRVis.Internal

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
Source 2 Viewer is an all-in-one tool to browse VPK archives, view, extract, and decompile Source 2 assets, including maps, models, materials, textures, sounds, and more.
Version Downloads Last Updated
1.0.0 1,287 5/3/2026
1.0.0-rc1 110 4/21/2026
0.3.13 166 4/18/2026
0.3.12 124 4/17/2026
0.3.11 17,375 8/14/2025
0.3.10 3,377 4/27/2025
0.3.9 1,057 2/13/2025
0.3.8 2,418 9/17/2024
0.3.7 1,298 8/4/2024
0.3.6 1,142 2/23/2024
0.3.5 509 8/7/2023
0.3.4 448 7/9/2023
0.3.3 335 6/6/2023
0.3.2 613 4/19/2023
0.3.1 401 4/4/2023
0.2.3 811 8/19/2022
0.2.2 611 8/16/2022
0.2.1 858 8/15/2022
0.2.0 587 8/14/2022
0.1.1 623 7/24/2022
Loading failed

update