mostlylucid.consoleimage
4.5.1
dotnet add package mostlylucid.consoleimage --version 4.5.1
NuGet\Install-Package mostlylucid.consoleimage -Version 4.5.1
<PackageReference Include="mostlylucid.consoleimage" Version="4.5.1" />
<PackageVersion Include="mostlylucid.consoleimage" Version="4.5.1" />
<PackageReference Include="mostlylucid.consoleimage" />
paket add mostlylucid.consoleimage --version 4.5.1
#r "nuget: mostlylucid.consoleimage, 4.5.1"
#:package mostlylucid.consoleimage@4.5.1
#addin nuget:?package=mostlylucid.consoleimage&version=4.5.1
#tool nuget:?package=mostlylucid.consoleimage&version=4.5.1
mostlylucid.consoleimage
High-quality ASCII art renderer for .NET 10 using shape-matching algorithm.
Full documentation with examples and demos on GitHub
Features
- ASCII Mode - Shape-matched characters using 6-point sampling grid
- ColorBlocks Mode - 2x vertical resolution using Unicode half-blocks (▀▄█)
- Braille Mode - 2x4 dots per cell for ultra-high resolution
- Matrix Mode - Digital rain effect with authentic color scheme
- GIF Animation - Render and play animated GIFs
- GIF Output - Save rendered output as animated GIF files
- Native AOT - Fully compatible with ahead-of-time compilation
Quick Start
using ConsoleImage.Core;
// One line - just works!
// All renderers auto-enable ANSI support on Windows.
Console.WriteLine(AsciiArt.Render("photo.jpg"));
// Colored output
Console.WriteLine(AsciiArt.RenderColored("photo.jpg"));
// Play animated GIF
await AsciiArt.PlayGif("animation.gif");
Note: All renderers (
AsciiRenderer,BrailleRenderer,ColorBlockRenderer,MatrixRenderer,UnifiedRenderer) automatically callConsoleHelper.EnableAnsiSupport()in their constructors. You only need to call it manually if you're writing raw ANSI escape codes to the console without using a renderer.
Render Modes
ASCII (Shape-Matched Characters)
Characters selected by visual shape similarity using 6-point sampling grid.
using var renderer = new AsciiRenderer(new RenderOptions { MaxWidth = 80 });
var frame = renderer.RenderFile("photo.jpg");
Console.WriteLine(frame.ToAnsiString()); // Colored
Console.WriteLine(frame.ToString()); // Plain text
ColorBlocks (Unicode Half-Blocks)
2x vertical resolution using ▀▄█ characters with 24-bit color.
using var renderer = new ColorBlockRenderer(new RenderOptions { MaxWidth = 80 });
string output = renderer.RenderFile("photo.jpg");
Console.WriteLine(output);
Braille (Ultra-High Resolution)
2x4 dots per character cell with autocontrast and selective dithering.
using var renderer = new BrailleRenderer(new RenderOptions { MaxWidth = 80 });
string output = renderer.RenderFile("photo.jpg");
Console.WriteLine(output);
Matrix (Digital Rain Effect)
Iconic falling code effect with authentic color scheme (white heads fading to green).
var options = new RenderOptions { MaxWidth = 80 };
var matrixOpts = new MatrixOptions
{
BaseColor = new Rgba32(0, 255, 65, 255), // Classic green
Density = 0.5f,
SpeedMultiplier = 1.0f,
TargetFps = 20,
UseAsciiOnly = false, // Set true for ASCII-only (no katakana)
CustomAlphabet = null // Or "01" for binary, "HELLO" for custom
};
using var renderer = new MatrixRenderer(options, matrixOpts);
// Static image with Matrix overlay
var frame = renderer.RenderFile("photo.jpg");
Console.WriteLine(frame.Content);
// Animated GIF with Matrix effect
var frames = renderer.RenderGif("animation.gif");
Matrix Presets:
var green = MatrixOptions.ClassicGreen; // Default green
var red = MatrixOptions.RedPill; // Red tint
var blue = MatrixOptions.BluePill; // Blue tint
var amber = MatrixOptions.Amber; // Retro amber
var fullColor = MatrixOptions.FullColor; // Source image colors
Custom Alphabets:
- Default: Half-width katakana + numbers + symbols
UseAsciiOnly = true: ASCII letters onlyCustomAlphabet = "01": Binary rainCustomAlphabet = "THEMATRIX": Custom characters
GIF Animation Playback
// Simple playback
await AsciiArt.PlayGif("animation.gif");
// With options
var options = RenderOptions.ForAnimation(loopCount: 3);
options.AnimationSpeedMultiplier = 1.5f;
using var renderer = new AsciiRenderer(options);
var frames = renderer.RenderGif("animation.gif");
using var player = new AsciiAnimationPlayer(frames, useColor: true);
await player.PlayAsync(cancellationToken);
GIF Output
Save rendered output as animated GIF file:
using var gifWriter = new GifWriter(new GifWriterOptions
{
FontSize = 10,
Scale = 1.0f,
MaxColors = 128,
LoopCount = 0 // 0 = infinite
});
using var renderer = new AsciiRenderer(options);
foreach (var frame in renderer.RenderGif("input.gif"))
{
gifWriter.AddFrame(frame, frame.DelayMs);
}
await gifWriter.SaveAsync("output.gif");
// For Matrix mode
using var matrixRenderer = new MatrixRenderer(options, matrixOpts);
foreach (var frame in matrixRenderer.RenderGif("input.gif"))
{
gifWriter.AddMatrixFrame(frame, frame.DelayMs, useBlockMode: false);
}
RenderOptions Reference
var options = new RenderOptions
{
// Dimensions
Width = null, // Exact width (null = auto)
Height = null, // Exact height (null = auto)
MaxWidth = 120, // Maximum width constraint
MaxHeight = 40, // Maximum height constraint
CharacterAspectRatio = 0.5f, // Terminal char width/height ratio
// Appearance
UseColor = true, // Enable ANSI colors
Invert = true, // For dark terminals (default)
ContrastPower = 2.5f, // Contrast enhancement (1.0-4.0)
Gamma = 0.65f, // Gamma correction
// Animation
AnimationSpeedMultiplier = 1.0f,
LoopCount = 0, // 0 = infinite
FrameSampleRate = 1, // Skip frames (2 = every 2nd)
// Features
EnableDithering = true, // Floyd-Steinberg dithering
EnableEdgeDetection = false, // Sobel edge detection
UseParallelProcessing = true // Multi-threaded rendering
};
Terminal Protocol Support
For terminals with native image protocols:
using var renderer = new UnifiedRenderer(new RenderOptions { MaxWidth = 80 });
// Auto-detect best protocol
string output = renderer.RenderFile("photo.jpg", TerminalProtocol.Auto);
// Or specify explicitly
string sixel = renderer.RenderFile("photo.jpg", TerminalProtocol.Sixel);
string iterm = renderer.RenderFile("photo.jpg", TerminalProtocol.ITerm2);
string kitty = renderer.RenderFile("photo.jpg", TerminalProtocol.Kitty);
// Check capabilities
var protocol = TerminalCapabilities.DetectBestProtocol();
bool hasSixel = TerminalCapabilities.SupportsSixel();
Performance
- SIMD optimized (Vector128/256/512)
- Parallel processing for multi-core rendering
- Pre-computed lookup tables
- K-D tree for fast character matching
- Result caching with quantized lookups
Related Packages
- mostlylucid.consoleimage.video - FFmpeg video playback
Attribution
- ASCII shape-matching: Based on Alex Harri's approach
- Braille autocontrast: Inspired by img2braille
- Matrix color scheme: Based on digital rain analysis
License
Public domain - UNLICENSE
| 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
- Microsoft.Extensions.Configuration.Binder (>= 10.0.2)
- mostlylucid.consoleimage.player (>= 4.5.1)
- SharpCompress (>= 0.44.4)
- SixLabors.Fonts (>= 2.1.3)
- SixLabors.ImageSharp (>= 3.1.12)
- SixLabors.ImageSharp.Drawing (>= 2.1.7)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on mostlylucid.consoleimage:
| Package | Downloads |
|---|---|
|
mostlylucid.consoleimage.video
Video-to-ASCII renderer using FFmpeg. Streams video files as ASCII art with intelligent frame sampling, scene detection, and hardware acceleration. AOT compatible. |
|
|
mostlylucid.consoleimage.spectre
Spectre.Console integration for ConsoleImage. Provides IRenderable implementations for displaying ASCII art, color blocks, and braille images within Spectre.Console layouts. Supports animated GIFs with Live display. |
|
|
mostlylucid.consoleimage.transcription
Whisper-based audio transcription for ConsoleImage. Auto-generates subtitles from video/audio files using OpenAI Whisper models. Supports speaker diarization and multiple output formats (SRT, VTT). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.5.1 | 32 | 2/1/2026 |
| 4.5.0 | 29 | 2/1/2026 |
| 4.5.0-rc1 | 23 | 2/1/2026 |
| 4.5.0-rc0 | 37 | 2/1/2026 |
| 4.5.0-alpha5 | 26 | 2/1/2026 |
| 4.5.0-alpha3 | 18 | 2/1/2026 |
| 4.5.0-alpha2 | 35 | 2/1/2026 |
| 4.5.0-alpha1 | 37 | 2/1/2026 |
| 4.5.0-alpha0 | 38 | 2/1/2026 |
| 4.1.2 | 245 | 1/26/2026 |
| 4.1.2-rc4 | 111 | 1/26/2026 |
| 4.1.2-rc3 | 110 | 1/26/2026 |
| 4.1.2-rc2 | 112 | 1/26/2026 |
| 4.1.2-rc1 | 107 | 1/26/2026 |
| 4.1.2-rc0 | 105 | 1/26/2026 |
| 4.1.1-alpha2 | 104 | 1/26/2026 |
| 4.1.1-alpha1 | 115 | 1/26/2026 |
| 4.1.1-alpha0 | 117 | 1/26/2026 |
| 4.1.0 | 113 | 1/25/2026 |
| 4.1.0-rc0 | 112 | 1/25/2026 |
| 4.1.0-alpha3 | 108 | 1/26/2026 |
| 4.1.0-alpha2 | 112 | 1/25/2026 |
| 4.1.0-alpha1 | 111 | 1/25/2026 |
| 4.1.0-alpha0 | 110 | 1/25/2026 |
| 4.0.0-rc4 | 112 | 1/25/2026 |
| 4.0.0-rc2 | 100 | 1/25/2026 |
| 4.0.0-rc1 | 101 | 1/25/2026 |
| 4.0.0-rc0 | 99 | 1/25/2026 |
| 3.2.0 | 107 | 1/24/2026 |
| 3.1.0 | 117 | 1/24/2026 |
| 3.0.3-alpha.0.1 | 39 | 1/24/2026 |
| 3.0.2 | 103 | 1/24/2026 |
| 3.0.0 | 102 | 1/24/2026 |
| 2.7.1 | 100 | 1/24/2026 |
| 2.7.0 | 102 | 1/24/2026 |
| 2.6.9-preview2 | 96 | 1/24/2026 |
| 2.6.9-preview1 | 100 | 1/24/2026 |
| 2.6.9-preview0 | 98 | 1/24/2026 |
| 2.6.6 | 109 | 1/22/2026 |
| 2.6.5 | 105 | 1/22/2026 |
| 2.6.4 | 105 | 1/22/2026 |
| 2.6.3 | 101 | 1/22/2026 |
| 2.6.1 | 99 | 1/22/2026 |
| 2.6.0 | 107 | 1/22/2026 |
| 2.5.1 | 102 | 1/22/2026 |
| 2.5.0 | 82 | 1/22/2026 |
| 2.3.0 | 83 | 1/21/2026 |
| 2.2.0 | 85 | 1/21/2026 |
| 2.1.0 | 87 | 1/21/2026 |
| 2.0.0 | 85 | 1/21/2026 |
| 2.0.0-alpha0 | 98 | 1/21/2026 |
| 1.6.0 | 79 | 1/20/2026 |
| 1.5.2 | 79 | 1/20/2026 |
| 1.5.1 | 83 | 1/20/2026 |
| 1.5.0 | 85 | 1/20/2026 |
| 1.3.0 | 74 | 1/20/2026 |
| 1.2.0 | 85 | 1/20/2026 |
| 1.1.0 | 89 | 1/18/2026 |
| 1.0.0 | 82 | 1/18/2026 |
| 0.0.2 | 82 | 1/18/2026 |
| 0.0.1 | 86 | 1/18/2026 |