TinyEXR.NET 1.3.0

dotnet add package TinyEXR.NET --version 1.3.0
                    
NuGet\Install-Package TinyEXR.NET -Version 1.3.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="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TinyEXR.NET" Version="1.3.0" />
                    
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.3.0
                    
#r "nuget: TinyEXR.NET, 1.3.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.
#:package TinyEXR.NET@1.3.0
                    
#: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.3.0
                    
Install as a Cake Addin
#tool nuget:?package=TinyEXR.NET&version=1.3.0
                    
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 third-party runtime dependencies. The netstandard2.1 target depends on SharpZipLib.

Features

The format and compression comparison uses this library's 3.1 API, TinyEXR V3 at eb0ba07, and official OpenEXR 3.5.3 at 3950290. Yes means read and write; limitations are stated explicitly. Native capabilities assume the relevant build options and codec dependencies are enabled.

Format / compression TinyEXR.NET TinyEXR V3 Official OpenEXR
Flat scanline images Yes Yes Yes
Tiled images, mipmaps and ripmaps Yes Yes Yes
Multipart, including mixed flat/deep parts Yes Yes Yes
Deep scanline and tiled images, including mip/rip levels Yes Yes Yes
Mixed HALF / FLOAT / UINT channels; scanline subsampling Yes Yes Yes
Header metadata, custom attributes and RGBA8 previews Yes Yes Yes
Flat NONE, RLE, ZIP, ZIPS, PIZ, PXR24, B44, B44A Yes Yes Yes
Flat HTJ2K32 / HTJ2K256 Yes Yes Yes
Flat DWAA / DWAB Partial: raw fallback reads only; no encoding [1] No compressed codec; raw fallback reads only Yes
Flat LJ2K (official ID 12) Recognized; codec not implemented No; ID 12 means ZSTD in this revision [2] Yes
Flat ZSTD (official ID 13) Recognized; codec not implemented Private ID 12 only [2] Yes
Deep compression NONE, RLE, ZIPS NONE, RLE, ZIPS plus nonstandard combinations [3] NONE, RLE, ZIPS, ZSTD
  1. Managed DWA reads are limited to raw fallback files that official OpenEXR can decode. Compressed DWA input and all DWA encoding requests return Unsupported.
  2. TinyEXR's private ZSTD numbering is incompatible with this pinned official format. TinyEXR.NET follows official LJ2K = 12 and ZSTD = 13; it does not interpret ID 12 as ZSTD.
  3. Deep support is constrained by official compression validity. TinyEXR.NET rejects nonstandard deep combinations and retains its per-row count and row/channel sample-layout fixes. Tiled and deep channels require unit sampling; flat scanline sampling must align with the data window.

Official OpenEXR is the format and codec correctness reference; TinyEXR is a port source. See the detailed support matrix and port provenance and interoperability coverage.

Usage

The TinyEXR namespace exposes the immutable V3 models and the Exr convenience methods. Data sources and sinks live in TinyEXR.IO. All I/O uses ExrReader and ExrWriter. The former V1 models, status codes and implementation have been removed; version 1.3.0 introduces this breaking source and binary change. Rebuild consumers against the new package. The managed API identifier remains 3.1.0. See the V3-only migration guide and V3.1 migration guide, and codec port provenance.

RGBA convenience loading:

using TinyEXR;

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

Modern managed API (based on upstream v3):

using TinyEXR;

ReaderResult<Image> load = ExrFile.LoadFromFile(inputPath);
if (!load.IsSuccess || load.Value is not Image image)
{
    throw new InvalidOperationException($"EXR load failed: {load.Status}", load.Error);
}

Part firstPart = image.Parts[0];
PartLevel baseLevel = firstPart.GetLevel(0, 0);

Console.WriteLine(
    $"{firstPart.Header.PartType}: {baseLevel.Width}x{baseLevel.Height}, " +
    $"{baseLevel.Channels.Count} channels");

WriterResult save = ExrFile.SaveToFile(image, outputPath);
if (!save.IsSuccess)
{
    throw new InvalidOperationException($"EXR save failed: {save.Status}", save.Error);
}

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

Benchmarks compare TinyEXR.NET, TinyEXR V3 and official OpenEXR 3.5.3 using complete image loads and saves in memory. The main metric is raw pixel throughput, including parsing, allocations and file assembly. Decode uses the same official input bytes; TinyEXR's two HTJ2K Decode entries are explicitly Unsupported. Correctness continues to use official OpenEXR alone. See Benchmark/README.md for the 64-item matrix, timing boundaries and reproducible commands.

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.

Migrating existing code

Use the namespace migration table when migrating from TinyEXR.V3. Use the V3-only migration guide for the removed V1 types and changed Exr signatures. Rebuild all dependent assemblies. Exr retains method names and out style, while accepting Part / Image and returning ExrResult. Native-wrapper consumers from v0.3.x must also replace native structs and P/Invoke calls with these managed models.

Known limitations

DWAA/DWAB accept only raw fallback blocks that official OpenEXR can read; compressed decoding and all encoding requests return Unsupported. LJ2K = 12 and ZSTD = 13 use official compression IDs and are not implemented. Deep ZIP, PIZ, B44, DWA and HTJ2K are invalid combinations, including raw blocks. Tiled/deep sampling must be one; flat scanline sampling must align to window origins and dimensions. See the support matrix.

License

The NuGet package declares MIT for the original managed code; see LICENSE. Distributed V3 codec ports retain their upstream BSD-3-Clause/BSD-2-Clause notices in THIRD-PARTY-NOTICES. Native test and benchmark tools are not included in the package.

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 (2)

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

Package Downloads
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.3.0 292 11/7/2026
1.2.0 2,618 10/1/2026
1.1.0 15,688 7/26/2026
1.0.0 6,403 5/3/2026
1.0.0-rc1 148 4/21/2026
0.3.13 321 4/18/2026
0.3.12 168 4/17/2026
0.3.11 25,658 8/14/2025
0.3.10 4,021 4/27/2025
0.3.9 3,611 2/13/2025
0.3.8 2,606 9/17/2024
0.3.7 1,793 8/4/2024
0.3.6 1,236 2/23/2024
0.3.5 582 8/7/2023
0.3.4 485 7/9/2023
0.3.3 369 6/6/2023
0.3.2 645 4/19/2023
0.3.1 429 4/4/2023
0.2.3 881 8/19/2022
0.2.2 651 8/16/2022
Loading failed

TinyEXR.NET 1.3.0 introduces the breaking V3-only API, now 3.1: official OpenEXR 3.5.3 verification, legal deep NONE/RLE/ZIPS only, official LJ2K/ZSTD IDs, contexts, resource budgets, typed attributes and Preview. V1 models and fallback paths are removed. Rebuild consumers; see docs/migration-v3.1.md and docs/migration-v3-only.md.