# Class ImageToAsciiService | EchoHub Documentation

# Class ImageToAsciiService

Namespace
  EchoHub.Core.Services

Assembly
  EchoHub.Core.dll

    public class ImageToAsciiService

Inheritance
  object
  ImageToAsciiService

Inherited Members
  object.GetType()
  object.MemberwiseClone()
  object.ToString()
  object.Equals(object)
  object.Equals(object, object)
  object.ReferenceEquals(object, object)
  object.GetHashCode()

## Constructors

### ImageToAsciiService()

    public ImageToAsciiService()

## Methods

### ConvertToAscii(Stream, int, int)

Converts an image to ASCII art using half-block characters (▀▄█) with printable color tags for 2x vertical resolution. Each character cell represents two vertical pixels. Format: {F:RRGGBB} foreground, {B:RRGGBB} background, {X} reset. Uses only printable ASCII — no terminal escape bytes.

    public string ConvertToAscii(Stream imageStream, int width = 80, int height = 80)

#### Parameters

`imageStream` Stream
`width` int
`height` int

#### Returns

string

### GetDimensions(string?)

Returns (width, height) dimensions for the given size code. s = small (40x40), m = medium/default (80x80), l = large (120x120).

    public static (int Width, int Height) GetDimensions(string? size)

#### Parameters

`size` string

#### Returns

(int Width, int Height)