PictureSharp.Tiff 0.5.0

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

PictureSharp.Tiff

TIFF for PictureSharp, in 100% C#. No native dependencies.

Reads and writes TIFF and BigTIFF on .NET 10+ with PictureSharp 0.7.9+. No native libraries or P/Invoke.

dotnet add package PictureSharp.Tiff

Use

Register the format once; Image.Load, Identify, ReadMetadata, EditMetadata and Save then handle .tif and .tiff:

using PictureSharp;
using PictureSharp.Formats.Tiff;

ImageConfiguration.Default = ImageConfiguration.Default.ToBuilder().AddFormat(new TiffFormat()).Build();

using var image = Image.Load("scan.tif");          // first page; ICC, EXIF and XMP kept
image.Mutate(x => x.AutoOrient().Resize(1600, 0));
image.SaveAsTiff("small.tif");                     // LZW, smallest lossless colour type
image.SaveAsTiff("photo.tif", new TiffEncoderOptions { Compression = TiffCompression.Jpeg, JpegQuality = 90 });

Other pages are selected with TiffDecoderOptions; every frame of an Image is written as a page:

int pages = Image.Identify("fax.tif").ContainerItemCount;
using var second = Image.Load("fax.tif", new DecoderOptions { FormatOptions = [new TiffDecoderOptions { Page = 1 }] });

A library can pass its own configuration through DecoderOptions.Configuration and EncoderOptions.Configuration instead of changing the default.

Support

Read classic TIFF and BigTIFF, both byte orders, strips and tiles, planar; none, PackBits, LZW, Deflate, JPEG, WebP, CCITT RLE, Group 3 and Group 4; greyscale 1–16 bits, palette, RGB and CMYK 8/16 bits, YCbCr, 32-bit float, with or without alpha; one page at a time
Write every frame as a page, strips or tiles, classic TIFF or BigTIFF; none, PackBits, LZW, Deflate, JPEG, WebP and CCITT Group 4; 8-bit grey, grey + alpha, RGB, RGBA, palette and 1-bit black and white; compressed in parallel
Metadata ICC, XMP, EXIF/GPS, orientation and resolution, read and written; EditMetadata without re-encoding
Not supported old-style JPEG, JBIG, LZMA, Zstandard, CIE Lab, signed samples; writing 16-bit, CMYK or planar data

Limits (MaxPixels, MaxInputBytes, MaxMetadataBytes) and cancellation work as for built-in formats. Decoded pixels match libtiff 4.5.1 and Pillow 10.2.0; lossless output reads back exactly in both, and LZW, PackBits and Group 4 data is byte-identical to libtiff's. LZW writing on one thread runs as fast as libtiff, and parallel compression on 16 threads is about 6× faster (measurements).

Guides: decoding · encoding · metadata

0.5.0 release notes: writing TIFF and BigTIFF, multi-page, tiles, parallel compression and EditMetadata.

License

MIT. Ported sources (libtiff, Pillow conversion rules) and their licenses are listed in THIRD-PARTY-NOTICES.txt. libtiff, Pillow and ImageMagick are used only as test oracles.

Build

dotnet build -c Release
dotnet test -c Release
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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.4 101 10/28/2026
0.7.3 90 10/26/2026
0.7.2 103 10/23/2026
0.7.1 103 10/22/2026
0.7.0 108 10/22/2026
0.6.0 96 10/22/2026
0.5.2 100 10/21/2026
0.5.1 108 10/21/2026
0.5.0 101 10/21/2026
0.4.0 111 10/21/2026
0.3.0 99 10/21/2026

0.5.0: writing TIFF and BigTIFF: every frame as a page, strips or tiles, None, PackBits, LZW, Deflate, JPEG, WebP and CCITT Group 4, compressed in parallel; Image.EditMetadata for TIFF; WebP compression is read. Requires PictureSharp 0.7.9. Notes: https://github.com/art-ix/PictureSharp.Tiff/blob/v0.5.0/docs/releases/release-0.5.0.md