Bsa.Image 1.1.8

dotnet add package Bsa.Image --version 1.1.8
                    
NuGet\Install-Package Bsa.Image -Version 1.1.8
                    
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="Bsa.Image" Version="1.1.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bsa.Image" Version="1.1.8" />
                    
Directory.Packages.props
<PackageReference Include="Bsa.Image" />
                    
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 Bsa.Image --version 1.1.8
                    
#r "nuget: Bsa.Image, 1.1.8"
                    
#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 Bsa.Image@1.1.8
                    
#: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=Bsa.Image&version=1.1.8
                    
Install as a Cake Addin
#tool nuget:?package=Bsa.Image&version=1.1.8
                    
Install as a Cake Tool

Bsa.Image

Managed image decoding, proportional resizing, and PNG and JPEG encoding for .NET 6, 8 and 10.

using Bsa.Image;

var format = ImageDecoder.DetectFormat(fileBytes);
if (ImageDecoder.CanDecode(format))
{
	var bitmap = ImageDecoder.Decode(fileBytes).ResizeToFit(256, 256);
	// Width, Height, Stride and Pixels describe an 8-bit BGRA raster.
}
Format Detection Decoding
PNG Yes Grayscale, indexed, RGB and alpha, including Adam7
BMP Yes BITMAPINFOHEADER family, BI_RGB and RGB bitfields
GIF Yes First frame, including transparency and interlacing
JPEG Yes 8-bit sequential and progressive, including grayscale, RGB, CMYK and YCCK
WebP Yes VP8 and VP8L, including alpha and the first animation frame
TIFF Yes First page of TIFF or BigTIFF, including strips, tiles, alpha, JPEG, CCITT, LZW, Deflate and PackBits
ICO Yes Largest icon, with an embedded PNG or a DIB and its transparency mask
AVIF Yes Still image or first sequence frame in 8-bit BGRA, including alpha. Requires .NET JIT
TGA Yes Truecolor, grayscale and indexed images, with raw or RLE pixels
QOI Yes RGB and RGBA
PBM, PGM, PPM Yes Text and binary Netpbm (P1–P6), including 16-bit samples
PAM/P7 Yes Standard grayscale, RGB and black-and-white tuples, including alpha and 16-bit samples
PSD, PSB Yes Saved composite in bitmap, indexed, grayscale or RGB mode. Raw, PackBits and ZIP, including prediction for 8- and 16-bit samples
JPEG XL Yes First image in a bare codestream or container, with alpha. .NET 8 and 10
HEIF/HEIC Yes HEVC Main and Main 10 still images, including tiled photos and container transforms. .NET 10

TGA 2.0 is detected by the footer. For TGA 1.0, detection requires a complete raster. TGA interleaving is outside the supported subset. Binary Netpbm sequences return their first image.

Decoded pixels use straight alpha and top-down rows. Animated GIF and WebP return the first frame. For WebP the first frame is placed at its encoded position on a transparent canvas. BMP RLE compression is outside the current scope. PNG decoding reads the default image from APNG. PSD and PSB require a saved composite and do not render layers. CMYK, Lab and 32-bit Photoshop images are outside the supported subset. JPEG XL and HEIF signatures are detected on every target framework. Use CanDecode to check availability. HEIC output is opaque. HEIF sequences, auxiliary images, and non-HEVC payloads are outside the HEIF decoder's scope.

Codec-specific color conversion and orientation handling follow the supported subsets above. Decoders limit rasters to 50 million pixels. Use ImageEncoder.EncodePng(bitmap) for lossless output with alpha, or ImageEncoder.EncodeJpeg(bitmap, options) for baseline JPEG. Raw BGRA buffers can be passed to Bsa.Image.Encoders.PngEncoder.EncodeBgra. The JPEG encoder accepts a Bsa.Image.Encoders.JpegSource and supports quality, chroma subsampling, grayscale and JFIF density.

The built-in C# JPEG and TIFF decoders share the JPEG implementation. TIFF supports standard JPEG segments with optional shared JPEGTables (Compression 7) and baseline old-style JPEG (Compression 6). It supports both byte orders, classic and BigTIFF directory layouts, and unsigned integer samples. BigTIFF data must fit the input byte array. The WebP bitstream readers are adapted from the MIT-licensed ImgSmush. The package includes the ImgSmush license. The WebP decoder uses the portable scalar color conversion on all target frameworks.

AVIF uses libavif and dav1d as embedded WebAssembly translated to IL by WebAssembly for .NET. The AVIF module sources, versions and licenses are described in the decoder notes. JPEG XL uses the managed PeachImage 0.7.4. HEIF/HEIC uses the managed Sdcb.SimdCodecs.Heif 2.0.0. The HEIF decoder package's MIT license does not grant a licence to HEVC patents.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 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 (1)

Showing the top 1 NuGet packages that depend on Bsa.Image:

Package Downloads
Bsa.Pdf.Convert

Convert Word (.docx), Excel (.xlsx) and PDF documents to page images (PNG, JPEG, multi-page TIFF) and Word/Excel to PDF in C#: own layout engine for paragraphs, tables, headers and footers, footnotes, EMF/WMF pictures and Excel charts; pages are rendered with PDFium. No Microsoft Office, LibreOffice or Open XML SDK; Windows, Linux, macOS.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.8 80 11/26/2026
1.1.7 80 11/25/2026
1.1.6 78 11/25/2026
1.1.5 69 11/25/2026
1.1.4 51 11/25/2026
1.1.2 53 11/25/2026