LithoSharp.Images
2.2.0
See the version list below for details.
dotnet add package LithoSharp.Images --version 2.2.0
NuGet\Install-Package LithoSharp.Images -Version 2.2.0
<PackageReference Include="LithoSharp.Images" Version="2.2.0" />
<PackageVersion Include="LithoSharp.Images" Version="2.2.0" />
<PackageReference Include="LithoSharp.Images" />
paket add LithoSharp.Images --version 2.2.0
#r "nuget: LithoSharp.Images, 2.2.0"
#:package LithoSharp.Images@2.2.0
#addin nuget:?package=LithoSharp.Images&version=2.2.0
#tool nuget:?package=LithoSharp.Images&version=2.2.0
LithoSharp.Images
Add declared, cached responsive raster image transforms to LithoSharp documentation sites (.NET 10). Use them alongside C# content contracts and build/output checks; image transforms do not replace those checks.
This checkout targets the next 2.2 candidate, not a published release. Use the
exact supplied candidate version and feed; set LithoSharpVersion to that value
for XML examples and replace <candidate-version> in commands. The published
stable baseline is 2.1.3; do not mix that line with candidate packages.
dotnet add package LithoSharp.Images --version <candidate-version>
Use matching Core and Images versions. Register the same ImageAsset declaration
instances with generation and rendering so their declared outputs can be resolved.
using LithoSharp;
using LithoSharp.Images;
var image = new ImageAsset(
new SiteAsset("photo", "assets", "photo.jpg", "images/original.jpg"),
[new ImageVariant("jpeg", "images/photo.jpg", 640, ImageFormat.Jpeg),
new ImageVariant("webp", "images/photo.webp", 640, ImageFormat.WebP)]);
var options = new SiteGenerationOptions
{
Assets = [image.Source],
AssetTransforms = [image.Transform],
AssetCacheDirectory = ".lithosharp/assets"
};
// In a layout: ResponsiveImage.Render(context.Assets, image, "Lake at dawn")
The renderer encodes alt text and attributes and emits intrinsic dimensions,
format sources, srcset, sizes and lazy loading. PNG/JPEG fallback, positive widths,
quality 0–100 and distinct format/width pairs are required. Invalid images fail
before output publication. Cached bytes are verified; corrupt entries regenerate.
Place the cache outside the output directory. RAW and DNG sources are unsupported
by SkiaSharp 4.153.1; convert them to PNG or JPEG before declaring an image.
On Linux, install the .NET native prerequisites, including libstdc++.so.6;
SkiaSharp 4.153.1 needs it even with Linux.NoDependencies.
PNG/JPEG/WebP need no external executable. AVIF requires a trusted avifenc path:
new ExternalAvifEncoder(path, dependencyFingerprint: "installed-tool-and-codec-versions").
Pass it to ImageAsset with an AVIF variant and a fallback. Tool bytes and settings
are fingerprinted; changed tools are rejected even on cache hits. Recreate declarations
after updates. No PATH discovery or downloads occur. See the official
avifenc manual.
See assets and images for source roots, output paths, transform registration and cache restrictions.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- LithoSharp (>= 2.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.0 | 94 | 11/20/2026 |
| 3.1.0 | 117 | 11/17/2026 |
| 3.0.0 | 93 | 11/16/2026 |
| 2.2.0 | 400 | 11/9/2026 |
| 2.1.3 | 92 | 11/7/2026 |
| 2.1.2 | 112 | 10/31/2026 |
| 2.1.1 | 100 | 10/29/2026 |
| 2.1.0 | 97 | 10/28/2026 |
| 2.0.1 | 96 | 10/25/2026 |
| 2.0.0 | 125 | 10/17/2026 |
| 1.1.0 | 705 | 10/7/2026 |
| 1.0.0 | 498 | 9/15/2026 |
| 0.3.1 | 127 | 9/9/2026 |
| 0.3.0 | 134 | 9/8/2026 |