mostlylucid.consoleimage 3.1.0

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

mostlylucid.consoleimage

High-quality ASCII art renderer for .NET 10 using shape-matching algorithm.

NuGet License: Unlicense

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;

// Enable Windows ANSI support (call once at startup)
ConsoleHelper.EnableAnsiSupport();

// One line - just works!
Console.WriteLine(AsciiArt.Render("photo.jpg"));

// Colored output
Console.WriteLine(AsciiArt.RenderColored("photo.jpg"));

// Play animated GIF
await AsciiArt.PlayGif("animation.gif");

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 only
  • CustomAlphabet = "01": Binary rain
  • CustomAlphabet = "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

Attribution

License

Public domain - UNLICENSE

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 (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 43 2/1/2026
4.5.0 38 2/1/2026
4.5.0-rc1 32 2/1/2026
4.5.0-rc0 42 2/1/2026
4.5.0-alpha5 32 2/1/2026
4.5.0-alpha3 23 2/1/2026
4.5.0-alpha2 46 2/1/2026
4.5.0-alpha1 40 2/1/2026
4.5.0-alpha0 41 2/1/2026
4.1.2 246 1/26/2026
4.1.2-rc4 113 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 106 1/26/2026
4.1.1-alpha1 117 1/26/2026
4.1.1-alpha0 119 1/26/2026
4.1.0 113 1/25/2026
4.1.0-rc0 112 1/25/2026
4.1.0-alpha3 110 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