🎨 ASCII Art Generator

Real-time image-to-ASCII conversion with webcam support, batch processing, and multiple character sets.

Features

  • Real-time Conversion - Instant image-to-ASCII processing
  • Webcam Support - Live video ASCII conversion
  • Multiple Character Sets - Simple, detailed, block, and custom sets
  • Batch Processing - Convert multiple images at once
  • Advanced Options - Width, height, contrast, brightness controls
  • Export Functionality - Save ASCII art as text files
  • Dithering Effects - Floyd-Steinberg dithering support

Interactive Demo

Full Component Demo

ASCII Art Generator

📸

Click or drag & drop an image

Supported formats: JPEG, JPG, PNG, GIF, WEBP
Max file size: 5MB

60
30
1.0
0

Installation

import { 
  AsciiArtGenerator, 
  useAsciiArt,
  useWebcamAsciiArt,
  useBatchAsciiArt
} from 'react-ascii-ui';

Usage

Basic Component

function MyApp() {
  return (
    <AsciiArtGenerator 
      options={{ 
        width: 80, 
        height: 40, 
        style: 'detailed',
        contrast: 1.2,
        brightness: 0.8
      }}
      showControls={true}
      showWebcam={true}
      onGenerate={(result) => console.log(result)}
    />
  );
}

Using Hooks

function CustomConverter() {
  const { convertImage, isProcessing } = useAsciiArt();
  
  const handleFileUpload = async (file) => {
    const result = await convertImage(file, {
      width: 100,
      height: 50,
      style: 'block'
    });
    console.log(result.ascii);
  };
  
  return (
    <div>
      <input type="file" onChange={handleFileUpload} />
      {isProcessing && <p>Converting...</p>}
    </div>
  );
}

Character Sets

simple

.:-=+*#%@

detailed

.`'-_:;^,"~=+<>i!lI?/\|(){}[]rcvunxzjftLCJUYXZO0Qoahkbdpqwm*WMB8&%$#@

block

â–‘â–’â–“â–ˆ

binary

â–ˆ

Props

PropTypeDefaultDescription
optionsAsciiArtOptions-Conversion options (width, height, style, etc.)
showControlsbooleantrueShow adjustment controls
showWebcambooleanfalseEnable webcam support
onGeneratefunction-Callback when ASCII is generated

💡 Pro Tip

For best results with photographs, use the 'detailed' character set with medium width (60-100 characters). For logos or simple graphics, try the 'simple' or 'block' character sets. The webcam feature works best in good lighting conditions.