SharpAstro.Tiff 3.14.871

This package has a SemVer 2.0.0 package version: 3.14.871+43ac2412bbc86a491c7bc41d48c6828f0b8af1f1.
There is a newer version of this package available.
See the version list below for details.
dotnet add package SharpAstro.Tiff --version 3.14.871
                    
NuGet\Install-Package SharpAstro.Tiff -Version 3.14.871
                    
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="SharpAstro.Tiff" Version="3.14.871" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpAstro.Tiff" Version="3.14.871" />
                    
Directory.Packages.props
<PackageReference Include="SharpAstro.Tiff" />
                    
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 SharpAstro.Tiff --version 3.14.871
                    
#r "nuget: SharpAstro.Tiff, 3.14.871"
                    
#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 SharpAstro.Tiff@3.14.871
                    
#: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=SharpAstro.Tiff&version=3.14.871
                    
Install as a Cake Addin
#tool nuget:?package=SharpAstro.Tiff&version=3.14.871
                    
Install as a Cake Tool

SharpAstro Codecs

NuGet CI/CD

A family of pure-managed, AOT-compatible image-codec packages for .NET 10 — no native binaries. Each format ships as an independent NuGet, and SharpAstro.Codecs is a thin facade that sniffs a byte stream by its magic bytes and dispatches to the right decoder, so a consumer can reference one package instead of cherry-picking codecs.

Format Decode Encode Notes
PNG ✅ ✅ 8/16-bit RGBA/Gray, ICC + HDR chunks (cICP / mDCv / cLLI)
JPEG ✅ ✅ baseline + progressive; scaled 1/2–1/8 LOD decode; baseline encode. Plus lossless JPEG (T.81 Annex H) as a separate decoder
Ultra HDR ✅ ✅ gain-map JPEG; decodes transparently through the facade — float path is HDR, 8-bit path the SDR base
TIFF ✅ ✅ multi-page, 8/16/32-bit uint + float, Deflate/Zlib/LZW, Predictor 2
JPEG XR ✅ ✅ jxrlib-exact — codestream byte-identical to the reference encoder
OpenEXR ✅ ✅ scanline, HALF/FLOAT/UINT, NONE/RLE/ZIP/ZIPS/PIZ
JPEG XL ✅ ✅ clean-room; lossless Modular + lossy VarDCT
JBIG2 ✅ — bilevel, for PDF's /JBIG2Decode. Every region type T.88 defines, on the arithmetic path
EXIF ✅ — metadata only, from JPEG / TIFF / PNG

See CODECS.md for the full per-package matrix, what each codec does and does not support, and how to pick the right one. A bundled sRGB ICC profile ships in SharpAstro.Color.Icc for embedding.

All packages target net10.0, are IsAotCompatible, ship SourceLink debugging, and publish in lockstep (shared Major.Minor + CI run-number patch).

NuGet

# One facade for sniff-and-decode (PNG, JPEG incl. Ultra HDR, TIFF, JXR, EXR, JXL, .jb2):
dotnet add package SharpAstro.Codecs

# ...or reference just the format(s) you need:
dotnet add package SharpAstro.Png
dotnet add package SharpAstro.Jxr

Usage

Decode any supported still image through the facade — sniff the header, size a buffer, decode into it:

using SharpAstro.Codecs;

var bytes = File.ReadAllBytes(path);
if (ImageCodecs.TryReadInfo(bytes, out var info))
{
    var rgba = new byte[info.Width * info.Height * 4];
    ImageCodecs.TryDecodeIntoRgba8(bytes, rgba);      // zero-copy into your buffer
    // ...or ImageCodecs.TryDecode(bytes, out IDecodedImage img) for the full-fidelity raster.
}

Each codec is also usable directly — e.g. PngReader / PngWriter, JpegDecoder.Decode / DecodeTo, TiffReader / TiffWriter, JxrImageCodec, ExrImageCodec, JxlImageCodec. See CODECS.md.

JBIG2 is the one format whose main entry point is not the facade. A PDF-embedded JBIG2 stream has no file header to sniff, keeps its shared segment dictionaries in a separate /JBIG2Globals stream, and takes its dimensions from the image dictionary — so those callers pass all three explicitly:

using SharpAstro.Jbig2;

// `embedded` / `globals` are the PDF streams; width/height come from the image dictionary.
var page = Jbig2Decoder.Decode(embedded, globals, width, height);
var bits = page.Bits;        // one byte per pixel, 1 = black (T.88 polarity)
var gray = page.ToGray8();   // ...or the 8-bit projection, black 0 / white 255

Standalone .jb2 files do have a signature, and decode through the facade like anything else — generic, symbol-coded and halftone pages alike.

JBIG2 covers every region type T.88 defines on the arithmetic path: generic regions (both the template coder and MMR / ITU-T T.6, the Group 4 fax coding), refinement regions, symbol dictionaries and text regions, and pattern dictionaries with halftone regions. The Huffman-coded variants (SDHUFF / SBHUFF) are refused rather than guessed at — no available encoder emits them, so an implementation would have nothing to validate itself against.

Building from source

git clone https://github.com/SharpAstro/Codecs
cd Codecs
dotnet build Codecs.JustTests.sln -c Release
dotnet test  Codecs.JustTests.sln -c Release

Requires the .NET 10 SDK.

License

Unlicense (public domain).

Credits

This repository began as a fork of StbSharp/StbImageSharp (Roman Shapiro's C# port of Sean Barrett's stb_image.h, via the Hebron C-to-C# transpiler). SharpAstro.Jpeg's decoder was ported from and validated byte-exact against that reference decoder before the stb port itself was retired from the repo.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on SharpAstro.Tiff:

Package Downloads
TianWen.Lib

Astronomical imaging and device-control library for .NET: cameras, mounts, focusers, filter wheels, cover/calibrators and guiders over ASCOM, Alpaca, ZWO, QHYCCD, Meade LX200, Skywatcher, OnStep and PHD2, plus plate solving, deep-sky and planetary stacking, auto-focus and unattended session automation. First-class multi-OTA (dual rig) support. AOT compatible.

SharpAstro.Jxr

Pure-managed JPEG XR (ITU-T T.832 / ISO/IEC 29199-2) encoder/decoder for .NET. AOT-compatible. The codec core is ported faithfully from Microsoft's jxrlib reference implementation and validated bit-exactly against it (byte-for-byte vs JxrEncApp; round-trips through JxrDecApp and Windows Photo / WIC). Reuses SharpAstro.Tiff for the T.833 .jxr container. Current pipeline: single-tile spatial YUV444 BD8 RGB, lossless and lossy, all three overlap levels.

SharpAstro.Exif

Pure-managed EXIF metadata reader and writer for .NET. Parses EXIF blobs from JPEG (APP1), TIFF (sub-IFD), and PNG (eXIf chunk) — all of which share the same TIFF-IFD structure. Strongly-typed projection of well-known tags + raw tag map for the long tail / vendor MakerNote. Write (3.22): ExifWriter.Build makes a TIFF-structured EXIF blob (Software, ImageDescription, Artist, DateTime, UserComment) that SharpAstro.Jpeg's JpegEncodeOptions.Exif embeds as an APP1 segment.

SharpAstro.Codecs

Image-codec facade over the SharpAstro codec family: sniff a byte stream's format by its magic-byte signature and dispatch to the matching decoder (PNG, JPEG, TIFF, JPEG XR, OpenEXR, JPEG XL, JBIG2, JPEG 2000, WebP), returning a codec-neutral IDecodedImage (fidelity tier: native bit depth + ColorEncoding colour signalling, with a ToFloats() RGBA float32 view) or decoding zero-copy into a caller-provided 8-bit RGBA buffer (display tier, integer-sample formats). AOT-compatible.

FC.SDK.Raw

Canon CR2 / CR3 raw-file decoder — pure managed C#, no external libraw / dcraw / EDSDK. Sibling to FC.SDK (Canon PTP device communication): one package for talking to the camera, one for decoding the files it writes.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.23.1201 25 10/25/2026
3.22.1171 122 10/25/2026
3.21.1151 39 10/25/2026
3.20.1121 28 10/25/2026
3.19.1091 35 10/24/2026
3.18.1061 59 10/20/2026
3.17.1041 922 10/20/2026
3.16.981 81 10/14/2026
3.16.961 52 10/13/2026
3.16.951 266 10/9/2026
3.16.941 89 10/7/2026
3.15.911 70 10/7/2026
3.14.891 6,280 10/7/2026
3.14.871 9,380 9/11/2026
3.14.841 71 9/11/2026
3.14.821 124 9/9/2026
3.14.811 71 9/9/2026
3.14.801 174 9/6/2026
3.13.781 70 9/6/2026
3.12.771 327 9/4/2026
Loading failed