Nullean.TerminalImages.Spectre 0.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nullean.TerminalImages.Spectre --version 0.2.1
                    
NuGet\Install-Package Nullean.TerminalImages.Spectre -Version 0.2.1
                    
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="Nullean.TerminalImages.Spectre" Version="0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nullean.TerminalImages.Spectre" Version="0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Nullean.TerminalImages.Spectre" />
                    
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 Nullean.TerminalImages.Spectre --version 0.2.1
                    
#r "nuget: Nullean.TerminalImages.Spectre, 0.2.1"
                    
#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 Nullean.TerminalImages.Spectre@0.2.1
                    
#: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=Nullean.TerminalImages.Spectre&version=0.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Nullean.TerminalImages.Spectre&version=0.2.1
                    
Install as a Cake Tool

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.

var capabilities = await TerminalImageDetector.DetectAsync();          // what does this terminal speak?
var renderer = new TerminalImageRenderer(capabilities);
renderer.RenderPng(File.ReadAllBytes("photo.png"), Console.Out);       // best protocol, scaled to fit

Site: https://terminal-images.nullean.net

Why

  • Zero dependencies. The core package has no PackageReferences: the PNG codec, resampler and all four encoders are managed code. No SkiaSharp, no ImageSharp, no native assets, so it publishes with NativeAOT (a 1.7 MB tcat binary).
  • 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. The wait ends when the terminal has said everything it will say.
  • Hosts, not just a library. Integrations for Spectre.Console, Terminal.Gui v2 and XenoAtom.Terminal.

Packages

Package For
Nullean.TerminalImages The core: image model, PNG codec, resampler, encoders, detection, renderer. No package dependencies.
Nullean.TerminalImages.Spectre A TerminalImage renderable for Spectre.Console
Nullean.TerminalImages.TerminalGui A TerminalImageView for Terminal.Gui v2, and detection that feeds Terminal.Gui's own pipeline
Nullean.TerminalImages.XenoAtom WriteImage for XenoAtom.Terminal (no SkiaSharp)

Documentation

Status

An early release. What has been verified, and how:

Verified How
Encoders, PNG codec, resampler, detection logic, renderer Unit tests, with mutation checks: each rule was broken on purpose to confirm a test fails
Probing a terminal (raw mode, timeout, restoring the terminal) The published NativeAOT binary run in a pseudo-terminal with a scripted terminal, on macOS and on Linux (in CI)
Terminal.Gui view A live Terminal.Gui application with its ANSI driver, in tests
XenoAtom Its in-memory backend
NativeAOT Published with warnings as errors on macOS arm64, and in CI on Linux, macOS and Windows, where the published binary also runs

Not yet verified: output on real terminals (Kitty, Ghostty, iTerm2, WezTerm, foot, Windows Terminal, xterm), and tmux or SSH. The terminal-specific choices in TerminalBrands come from how other terminal image tools and the terminals' documentation treat them. If a terminal misbehaves, tcat --diagnostics shows what was detected and why, and NULLEAN_TERMINAL_IMAGES=kitty|iterm2|sixel|blocks|none overrides it.

Try it

dotnet run --project examples/Nullean.TerminalImages.Cat -- --diagnostics               # what was detected, and why
dotnet run --project examples/Nullean.TerminalImages.Cat -- examples/sunset.png         # draw an image
dotnet run --project examples/Nullean.TerminalImages.Cat -- --protocol sixel examples/sunset.png

tcat reads PNG files only: the library has a PNG decoder, and no JPEG or GIF decoder.

License

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.2.2 90 11/12/2026
0.2.1 97 11/11/2026
0.1.0 93 11/10/2026