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
<PackageReference Include="Bsa.Pdf.Jpeg" Version="1.0.42" />
<PackageVersion Include="Bsa.Pdf.Jpeg" Version="1.0.42" />
<PackageReference Include="Bsa.Pdf.Jpeg" />
paket add Bsa.Pdf.Jpeg --version 1.0.42
#r "nuget: Bsa.Pdf.Jpeg, 1.0.42"
#:package Bsa.Pdf.Jpeg@1.0.42
#addin nuget:?package=Bsa.Pdf.Jpeg&version=1.0.42
#tool nuget:?package=Bsa.Pdf.Jpeg&version=1.0.42
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 | Versions 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. |
-
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.