Skip to main content
net10.0

Show images in the terminal with the Kitty, iTerm2 and Sixel protocols, with protocol detection and a half-block fallback. No dependencies, NativeAOT-safe.

Published
Nov 12, 2026
11d ago
Total Downloads
2.5K
2,481

Install

dotnet add package Nullean.TerminalImages --version 0.2.2
ProductVersions
.NET
net10.0

README

Nullean.TerminalImages

terminal-images_

Show images in the terminal with the Kitty, iTerm2 and Sixel protocols, with protocol detection and a half-block fallback. No dependencies, NativeAOT-safe.

NuGet

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)");

examples/sunset.png drawn with the Sixel protocol, and with the half-block fallback

  • 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 RgbaImage from RGBA bytes yourself.
  • Redirected output detects as None and nothing is written; force a protocol with TerminalImageDetectionOptions.Protocol to write escape sequences into a file anyway.
  • NULLEAN_TERMINAL_IMAGES=kitty|iterm2|sixel|blocks|none|auto overrides detection without code, and capabilities.Diagnostics says 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

Changes from Previous Version

No structural changes between v0.2.1 and v0.2.2.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.