image_to_ascii 0.0.1 copy "image_to_ascii: ^0.0.1" to clipboard
image_to_ascii: ^0.0.1 copied to clipboard

Convert images or camera output to ASCII art in real-time.

image_to_ascii #

Convert images or camera output to ASCII art in real-time.

Camera Edit Edit

Usage #

Real-time camera preview #

import 'package:image_to_ascii/image_to_ascii.dart';

// Create camera controller
final controller = AsciiCameraController();
await controller.initialize();

// Display live ASCII using StreamBuilder
StreamBuilder(
  stream: controller.stream,
  builder: (context, snapshot) {
    if (snapshot.hasData) {
      return AsciiImageWidget(
        ascii: AsciiImage.fromSimpleString(snapshot.data!),
      );
    }
    return CircularProgressIndicator();
  },
)

// Control flash
await controller.flashOn();
await controller.flashOff();
await controller.flashAuto();

// Switch cameras
await controller.switchToFront();
await controller.switchToBack();

// Take a picture and convert to ASCII
final picture = await controller.takePicture();
// Then pass to convertImagePathToAscii()

// Dispose when done
await controller.dispose();

Convert image to ASCII #

import 'package:image_to_ascii/image_to_ascii.dart';

// Convert image file to ASCII
final asciiImage = await convertImagePathToAscii('path/to/image.png');

// Or convert a ui.Image directly
final asciiImage = await convertImageToAscii(uiImage);

// Display
AsciiImageWidget(ascii: asciiImage)

Options #

  • width / height - Set output dimensions (density)
  • dark / darkMode - Invert colors (white text on black)
  • color - Enable colored ASCII output
AsciiCameraController(
  darkMode: true,
  width: 150,
);

convertImagePathToAscii(
  'image.png',
  width: 100,
  dark: true,
  color: true,
);
3
likes
140
points
101
downloads

Documentation

API reference

Publisher

verified publishereko-app.com

Weekly Downloads

Convert images or camera output to ASCII art in real-time.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

camera, camera_avfoundation, flutter, google_fonts

More

Packages that depend on image_to_ascii