Nullean.TerminalImages
0.2.2
dotnet add package Nullean.TerminalImages --version 0.2.2
NuGet\Install-Package Nullean.TerminalImages -Version 0.2.2
<PackageReference Include="Nullean.TerminalImages" Version="0.2.2" />
<PackageVersion Include="Nullean.TerminalImages" Version="0.2.2" />
<PackageReference Include="Nullean.TerminalImages" />
paket add Nullean.TerminalImages --version 0.2.2
#r "nuget: Nullean.TerminalImages, 0.2.2"
#:package Nullean.TerminalImages@0.2.2
#addin nuget:?package=Nullean.TerminalImages&version=0.2.2
#tool nuget:?package=Nullean.TerminalImages&version=0.2.2
Nullean.TerminalImages

Show images in the terminal with the Kitty, iTerm2 and Sixel protocols, with protocol detection and a half-block fallback. No dependencies, NativeAOT-safe.
Install
dotnet add package Nullean.TerminalImages
Quick start
using Nullean.TerminalImages;
using Nullean.TerminalImages.Detection;
// Reads the environment, then asks the terminal once (macOS/Linux): Kitty, iTerm2, Sixel or half blocks?
var capabilities = await TerminalImageDetector.DetectAsync();
var renderer = new TerminalImageRenderer(capabilities, new TerminalImageRenderOptions { MaxColumns = 60, MaxRows = 20 });
if (!renderer.RenderPng(File.ReadAllBytes("sunset.png"), Console.Out))
Console.WriteLine("(this terminal cannot show images)");

- Zero dependencies. The PNG codec, resampler and all four encoders are managed code: no SkiaSharp, no ImageSharp, no native assets.
- Detection that does not hang. It reads the environment first, then asks the terminal once with a batch of queries that always ends with a Device Attributes request, which every terminal answers.
- Only PNG is decoded; for other formats build an
RgbaImagefrom RGBA bytes yourself. - Redirected output detects as
Noneand nothing is written; force a protocol withTerminalImageDetectionOptions.Protocolto write escape sequences into a file anyway. NULLEAN_TERMINAL_IMAGES=kitty|iterm2|sixel|blocks|none|autooverrides detection without code, andcapabilities.Diagnosticssays why detection chose what it did.- Detection sees through tmux and wraps output in its passthrough; tmux itself must have
allow-passthrough on. - For Spectre.Console, Terminal.Gui or XenoAtom.Terminal use the
Nullean.TerminalImages.<Host>package.
Learn more
- Documentation: https://terminal-images.nullean.net
- Detection: https://terminal-images.nullean.net/detection/
- The protocols: https://terminal-images.nullean.net/protocols/
- Troubleshooting: https://terminal-images.nullean.net/troubleshooting/
- Source and issues: https://github.com/nullean/terminal-images
| 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
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Nullean.TerminalImages:
| Package | Downloads |
|---|---|
|
Nullean.Snapshots.Browser.Console
Runs a suite of journeys from the console with streamed results, grouped skips and readable failures, for snap journey run and for any tool that wants the same output. |
|
|
Nullean.TerminalImages.XenoAtom
Show images in XenoAtom.Terminal with the Kitty, iTerm2 or Sixel protocol, with half blocks as the fallback. Independent of XenoAtom.Terminal.Graphics and SkiaSharp. |
|
|
Nullean.TerminalImages.Spectre
Show images in Spectre.Console with the Kitty, iTerm2 or Sixel protocol, falling back to half blocks drawn with Spectre's own colours. |
|
|
Nullean.TerminalImages.TerminalGui
Show images in Terminal.Gui v2: a view that feeds Terminal.Gui's Sixel and Kitty pipeline, a half-block fallback, and detection that Terminal.Gui's own handshake cannot do (probing, SSH, tmux). |
GitHub repositories
This package is not used by any popular GitHub repositories.