SharpAstro.Png
3.6.561
See the version list below for details.
dotnet add package SharpAstro.Png --version 3.6.561
NuGet\Install-Package SharpAstro.Png -Version 3.6.561
<PackageReference Include="SharpAstro.Png" Version="3.6.561" />
<PackageVersion Include="SharpAstro.Png" Version="3.6.561" />
<PackageReference Include="SharpAstro.Png" />
paket add SharpAstro.Png --version 3.6.561
#r "nuget: SharpAstro.Png, 3.6.561"
#:package SharpAstro.Png@3.6.561
#addin nuget:?package=SharpAstro.Png&version=3.6.561
#tool nuget:?package=SharpAstro.Png&version=3.6.561
SharpAstro Codecs
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.
Formats: PNG (read/write), JPEG (baseline + progressive decode, incl. scaled 1/2–1/8 LOD), TIFF (read/write), JPEG XR (read/write, jxrlib-exact), OpenEXR (read/write), JPEG XL (read/write), plus EXIF reading and a bundled sRGB ICC profile. See CODECS.md for the full per-package decode/encode matrix and how to pick the right one.
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):
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.
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 | Versions 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. |
-
net10.0
- SharpAstro.Codecs.Abstractions (>= 3.6.561)
- SharpAstro.Color.Icc (>= 3.6.561)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on SharpAstro.Png:
| 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.Fonts
Pure-managed, MIT-licensed C# OpenType / TrueType font loader and rasterizer. |
|
|
SharpAstro.Tiff
Pure-managed TIFF reader/writer for .NET. Supports multi-page, 8/16/32-bit uint and IEEE-Float samples, Uncompressed/Deflate/ZlibPkzip/LZW, Predictor 2 (horizontal differencing) on read, contig planar config, SampleFormat/SMin/SMax/ICC round-trip, both II and MM byte order. AOT-compatible. |
|
|
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), 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. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.14.871 | 319 | 9/11/2026 |
| 3.14.841 | 31 | 9/11/2026 |
| 3.14.821 | 93 | 9/9/2026 |
| 3.14.811 | 46 | 9/9/2026 |
| 3.14.801 | 150 | 9/6/2026 |
| 3.13.781 | 47 | 9/6/2026 |
| 3.12.771 | 393 | 9/4/2026 |
| 3.11.751 | 622 | 8/20/2026 |
| 3.10.721 | 130 | 8/20/2026 |
| 3.9.711 | 63 | 8/20/2026 |
| 3.8.701 | 1,500 | 8/20/2026 |
| 3.8.691 | 5,317 | 8/2/2026 |
| 3.8.681 | 145 | 7/29/2026 |
| 3.7.651 | 64 | 7/28/2026 |
| 3.6.561 | 475 | 7/27/2026 |
| 3.6.551 | 943 | 7/6/2026 |
| 3.6.531 | 66 | 7/5/2026 |
| 3.5.511 | 4,603 | 7/5/2026 |
| 3.4.491 | 610 | 7/5/2026 |
| 3.4.471 | 214 | 7/5/2026 |