Bsa.Pdf.Jpeg 1.0.20

There is a newer version of this package available.
See the version list below for details.
dotnet add package Bsa.Pdf.Jpeg --version 1.0.20
                    
NuGet\Install-Package Bsa.Pdf.Jpeg -Version 1.0.20
                    
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.20" />
                    
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.20" />
                    
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.20
                    
#r "nuget: Bsa.Pdf.Jpeg, 1.0.20"
                    
#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.20
                    
#: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.20
                    
Install as a Cake Addin
#tool nuget:?package=Bsa.Pdf.Jpeg&version=1.0.20
                    
Install as a Cake Tool

Bsa.Pdf.Jpeg

Кодирование JPEG на чистом C#: без нативных библиотек, без System.Drawing и ImageSharp. Работает везде, где есть .NET 6, .NET 8 или .NET 10 — Windows, Linux, macOS.

  • JPEG baseline (последовательный, коды Хаффмана из стандарта) в файле JFIF — читается любыми программами, в PDF встраивается фильтром DCTDecode как есть.
  • Оттенки серого (одна компонента) и цвет YCbCr с прореживанием 4:2:0 или 4:4:4.
  • Качество 1…100 — те же таблицы квантования, что у libjpeg: файл того же размера и вида, что у привычных программ.
  • Вход — пиксели Gray8, RGB, BGR, BGRA, RGBA с любым шагом строки (прозрачность не учитывается).

Установка

dotnet add package Bsa.Pdf.Jpeg

Пример

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

// Пиксели BGRA (например, из PDFium или SkiaSharp), шаг строки — stride байт.
var source = new JpegSource(width, height, stride, JpegPixelFormat.Bgra32, pixels);
var jpeg = JpegEncoder.Encode(source, new JpegEncoderOptions { Quality = 80 });
File.WriteAllBytes("page.jpg", jpeg);

// Сразу в поток.
using var file = File.Create("page.jpg");
JpegEncoder.Encode(source, new JpegEncoderOptions(), file);

Параметры (JpegEncoderOptions)

Параметр По умолчанию Что меняет
Quality 75 Качество 1…100. 75 — обычное, 85–90 — высокое, ниже 50 — заметные артефакты
Subsampling Chroma420 Chroma420 — цвет вдвое реже по обеим осям (меньше файл), Chroma444 — без прореживания (чётче цветные края)
Grayscale false Записать оттенки серого из цветных пикселей. Вход Gray8 всегда пишется серым

Ограничения

  • Только кодирование; чтение JPEG в библиотеку не входит.
  • Без прогрессивного режима, арифметического кодирования, CMYK и метаданных EXIF/ICC.
  • Изображение до 65535 × 65535 точек (предел формата).
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