Bsa.Pdf.Jpeg 1.0.42

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

Bsa.Pdf.Jpeg

JPEG encoding in pure C#: no native libraries, no System.Drawing, no ImageSharp. Works wherever .NET 6, .NET 8 or .NET 10 runs — Windows, Linux, macOS.

  • Baseline JPEG (sequential, standard Huffman tables) in a JFIF file — readable by any software and embeddable in PDF as is with the DCTDecode filter.
  • Grayscale (one component) and YCbCr color with 4:2:0 or 4:4:4 chroma subsampling.
  • Quality 1…100 with the same quantization tables as libjpeg: files of the same size and look as from familiar tools.
  • Input pixels: Gray8, RGB, BGR, BGRA, RGBA with any row stride (alpha is ignored).

Documentation in Russian: README.ru.md in the package.

Installation

dotnet add package Bsa.Pdf.Jpeg

Example

using System.IO;
using Bsa.Pdf.Jpeg;

// BGRA pixels (for example, from PDFium or SkiaSharp), row stride in bytes.
var source = new JpegSource(width, height, stride, JpegPixelFormat.Bgra32, pixels);
var jpeg = JpegEncoder.Encode(source, new JpegEncoderOptions { Quality = 80 });
File.WriteAllBytes("page.jpg", jpeg);

// Straight into a stream.
using var file = File.Create("page.jpg");
JpegEncoder.Encode(source, new JpegEncoderOptions(), file);

Options (JpegEncoderOptions)

Option Default Effect
Quality 75 Quality 1…100. 75 is typical, 85–90 is high, below 50 artifacts become visible
Subsampling Chroma420 Chroma420 — color at half resolution on both axes (smaller file), Chroma444 — no subsampling (sharper color edges)
Grayscale false Write grayscale from color pixels. Gray8 input is always written as grayscale

Limitations

  • Encoding only; JPEG decoding is not included.
  • No progressive mode, arithmetic coding, CMYK, EXIF or ICC metadata.
  • Images up to 65535 × 65535 pixels (format limit).
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.
  • net10.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

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

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.0.42 46 11/20/2026
1.0.20 50 11/19/2026