> ## Documentation Index
> Fetch the complete documentation index at: https://rdsciv/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Export ASCII Art as PNG, SVG, ANSI, or Text

> Save your ASCII art in five formats: PNG at 1×, 2×, or 4× scale; SVG with font embeds; ANSI truecolor; plain text; or clipboard.

The ASCII art converter gives you five ways to save your work. You can download a rasterized PNG at up to four times the native resolution, grab a scalable SVG that preserves every character as a vector element, export an ANSI escape-code file for terminal display, download a plain-text grid, or copy the text directly to your clipboard. Each format is available from the button group at the bottom of the sidebar.

<Tabs>
  <Tab title="PNG">
    ## PNG

    PNG is the default export format. It captures the canvas exactly as rendered, including all post-processing effects such as bloom, scanlines, vignette, chromatic aberration, and film grain.

    ### Scale

    Use the scale dropdown (labelled **1× PNG**, **2× PNG**, or **4× PNG**) in the sidebar to choose the output resolution. The exported image is the canvas scaled by the selected multiplier with pixel-perfect upscaling (no interpolation smoothing).

    | Scale | Use case                       |
    | ----- | ------------------------------ |
    | 1×    | Screen display, quick share    |
    | 2×    | Retina screens, moderate print |
    | 4×    | High-resolution print output   |

    <Tip>
      Use 4× PNG when you need high-resolution output for printing. At large canvas sizes the 4× file can be several thousand pixels wide, which is suitable for poster-scale prints without visible pixelation.
    </Tip>

    ### Transparent background

    Check the **Transparent** checkbox next to the scale dropdown to make the background transparent. When enabled, any pixel whose RGB values match the background color within a tolerance of ±8 per channel is set to fully transparent (alpha 0). This is useful for compositing ASCII art over other images or colored backgrounds.

    ### Filenames

    The exported filename encodes the scale and transparency options:

    | Settings            | Filename                   |
    | ------------------- | -------------------------- |
    | 1×, no transparency | `ascii.png`                |
    | 2×, no transparency | `ascii-2x.png`             |
    | 4×, no transparency | `ascii-4x.png`             |
    | 1×, transparent     | `ascii-1x-transparent.png` |
    | 2×, transparent     | `ascii-2x-transparent.png` |
    | 4×, transparent     | `ascii-4x-transparent.png` |

    ### Keyboard shortcut

    Press **S** to trigger the current PNG export settings immediately, without clicking the button.
  </Tab>

  <Tab title="SVG">
    ## SVG

    SVG export produces a vector file where every non-space character becomes an individual `<text>` element. Because the output is vector-based, you can scale it to any size in a browser or vector editor without any loss of quality.

    ### What the SVG contains

    * A `<rect>` element fills the background with the current background color.
    * Each character is placed with explicit `x` and `y` coordinates derived from the cell size and row height.
    * The `<g>` container carries `font-family`, `font-size` (equal to the cell size in pixels), and `font-weight` attributes matching the sidebar settings.
    * Colors are written as `fill` attributes using the same color mode logic as the canvas render — source color, palette snap, terminal color modes, and so on are all reflected accurately.
    * The characters `&`, `<`, and `>` are HTML-escaped to `&amp;`, `&lt;`, and `&gt;` respectively so the SVG remains valid XML.

    ### Filename

    The file is always saved as `ascii.svg`.

    <Note>
      SVG output embeds font-family names but does not bundle the font files themselves. The viewer must have the selected font available — either installed locally or loaded from a web font service — for the text to render in the correct typeface. If the font is unavailable, the viewer will fall back to its default monospace font, which will change character spacing and overall appearance.
    </Note>
  </Tab>

  <Tab title="ANSI">
    ## ANSI (.ans)

    ANSI export produces a plain-text file containing ANSI truecolor escape sequences. Each character is preceded by a foreground color code in the format `\x1b[38;2;R;G;Bm`, where R, G, and B are the raw pixel values sampled from the source image at that cell position. A reset code (`\x1b[0m`) is appended at the end of each line.

    ### How color is assigned

    The ANSI exporter samples the source image directly. It does **not** apply dithering post-effects; it uses a direct luminance-to-character mapping with contrast, gamma, and invert applied. The RGB values written into the escape sequences are the unmodified source pixel colors for each cell.

    ### Viewing the output

    Open the `.ans` file in any terminal emulator that supports truecolor ANSI sequences — for example, iTerm2, Alacritty, kitty, or Windows Terminal. Piping the file through `cat` is sufficient:

    ```bash theme={null}
    cat ascii.ans
    ```

    ### Filename

    The file is always saved as `ascii.ans`.
  </Tab>

  <Tab title="Plain text">
    ## Plain text (.txt)

    Plain text export saves the raw character grid with no color information. Every row of characters is separated by a newline, producing a file you can open in any text editor or paste into any monospace context.

    ### Character mapping

    The exporter uses the same luminance-to-character mapping as the canvas render. Contrast, gamma, and invert settings are all applied before the luminance value is quantized to a character index. The active character set (Light, Dense, Blocks, Binary, Dots, Hatching, or a custom set) determines which characters appear.

    ### Filename

    The file is always saved as `ascii.txt`.
  </Tab>

  <Tab title="Copy as text">
    ## Copy as text

    The **Copy as text** button copies the same character grid as the plain-text export directly to your clipboard, without downloading a file. This is useful for pasting into chat, code comments, or any text field that accepts monospace content.

    When the copy succeeds, the button label briefly changes to **Copied ✓** for approximately 1.2 seconds before reverting to its original label.

    The copied content is identical to what the TXT download would produce: contrast, gamma, and invert applied, no color, newline-separated rows.
  </Tab>
</Tabs>
