ImageSharp Documentation
repository·main·Indexed 27 days ago
https://github.com/sixlabors/imagesharpA high-performance, fully managed, and cross-platform 2D graphics API for .NET designed for image processing across device, cloud, and embedded/IoT scenarios. It includes support for various formats such as TGA and TIFF, with detailed capabilities for TIFF compression, photometric interpretation, and baseline/extension tags.
What's inside ImageSharp
- ImageSharp is a high-performance, fully managed, and cross-platform 2D graphics API. It is designed to be used in various .NET environments.
Use the TGA format encoder/decoder
mainImageSharp provides support for Truevision TGA files via an encoder and decoder. This allows you to read TGA images into anImageobject and saveImageobjects back to the TGA format.Manually build ImageSharp from source
mainYou can compile ImageSharp yourself using Visual Studio 2022 or via the command line on Windows and Linux/Unix.
Prerequisites
Setup Steps
- Clone the repository:
git clone https://github.com/SixLabors/ImageSharp- Configure Git to ignore mass reformatting commits:
git config blame.ignoreRevsFile .git-blame-ignore-revs- (Windows only) Enable long file paths (run as Administrator):
git config --system core.longpaths true- Initialize submodules:
git submodule update --init --recursivegit clone https://github.com/SixLabors/ImageSharp git config blame.ignoreRevsFile .git-blame-ignore-revs git config --system core.longpaths true git submodule update --init --recursiveInstall SixLabors.ImageSharp via NuGet
mainTo use ImageSharp in your .NET project, install the stable release via NuGet. For development or nightly builds, use the Feedz.io feed.
Package Name Release (NuGet) Nightly (Feedz.io) SixLabors.ImageSharpNuGet Package Feedz.io Feed Follow ImageSharp argument ordering conventions
mainWhen calling ImageSharp APIs, follow the established coding convention for argument ordering: if you are passing aConfigurationobject to a method, it should be provided as the first argument.TIFF Photometric Interpretation Support
mainThe TIFF codec supports several photometric interpretation formats for color and grayscale representation.
Supported Photometric Interpretations
Format Encoder Decoder Comments WhiteIsZero Y Y General + 1/4/8-bit optimised BlackIsZero Y Y General + 1/4/8-bit optimised Rgb (Chunky) Y Y General + Rgb888 optimised Rgb (Planar) Y General implementation only PaletteColor Y Y General implementation only TransparencyMask Separated (TIFF Extension) Y YCbCr (TIFF Extension) Y CieLab (TIFF Extension) Y CMYK Y Tiled Images Y TIFF Compression Format Support
mainThe ImageSharp TIFF codec supports various compression formats for both encoding and decoding. Note that the Decoder currently only supports decoding multi-frame images if they have the same dimensions.
Supported Compression Formats
Format Encoder Decoder Comments None Y Y Ccitt1D Y Y PackBits Y Y CcittGroup3Fax Y Y CcittGroup4Fax Y Y Lzw Y Y Based on ImageSharp GIF LZW implementation Old Jpeg Y Only with chunky configuration Jpeg (Technote 2) Y Y Deflate (Technote 2) Y Y Based on PNG Deflate Old Deflate (Technote 2) Y Webp Y TIFF Extension and Private Tags Reference
mainThe TIFF codec supports various extension and private tags. Below is a list of notable tags and their support status.
Extension Tags (Selected)
Tag Encoder Decoder Comments DocumentName Y Y PageName Y Y Predictor Y Y Only Horizontal InkSet Y CMYK YCbCrCoefficients Y YCbCrSubSampling Y XMP Y Y Private Tags (Selected)
Tag Encoder Decoder Comments IPTC Y Y ICC Profile Y Y Exif IFD - 0x8769 SubExif TIFF Baseline Tags Reference
mainThe following Baseline TIFF tags are supported by the ImageSharp TIFF codec. Use these to understand which metadata properties can be encoded or decoded.
Tag Encoder Decoder Comments ImageWidth Y Y ImageLength Y Y BitsPerSample Y Y Compression Y Y PhotometricInterpretation Y Y ImageDescription Y Y Make Y Y Model Y Y StripOffsets Y Y Orientation - Ignored SamplesPerPixel Y - Ignored (inferred from BitsPerSample) RowsPerStrip Y Y StripByteCounts Y Y XResolution Y Y YResolution Y Y PlanarConfiguration Y Encoding support only chunky ResolutionUnit Y Y Software Y Y DateTime Y Y Artist Y Y HostComputer Y Y ColorMap Y Y Copyright Y Y ExtraSamples Y Unspecified alpha data is not supported