Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image ASCII Art

English | 繁體中文

Static Badge License

The project is a simplified C language version of ASCII-generator.
It aims to reimplement part of its core functionalities in C, providing a simple tool for converting images into ASCII art.

Project Scope

  • Focuses on converting images to ASCII art. Convertion for videos is not included at this stage.
  • Simplifies the multilingual character sets from ASCII-generator, providing only general-purpose character sets and english character set.

Function Modules

File Name Description Status
img2txt.py Image → Text
img2img.py Image → Grayscale ASCII Art
img2img_color.py Image → Colored ASCII Art

How to Use

  1. Build Executable
    You can use either the Makefile or script/build.ps1 to compile the source code.
    The build process will generate main (Unix/Linux) or main.exe (Windows).

  2. Run main

    Parameters
        --type          Required. Function type.
        --input         Required. Path to the input image.
        --output        Required. Path to the output file.
        --num_cols      Optional. Number of output columns.
        --mode          Optional. Character set.
        --background    Optional. Background color.
    
    Accepted values and defaults
        --type          ["text", "image", "image_color"]
        --input         Path string
        --output        Path string
        --num_cols      Integer                           Default: 300
        --mode          ["simple", "complex", "english"]  Default: complex
        --background    ["white", "black"]                Default: black
    

    Example Commands

    Text Output
    ./main --type text --input ./input.png --output ./output.txt
    Grayscale ASCII Image Output (Black Background)
    ./main --type image --input ./input.png --output ./output.png --mode complex --background black
    Colored ASCII Image Output (White Background)
    ./main --type image_color --input ./input.png --output ./output.png --num_cols 200 --mode simple --background white

Demo

Raw Image

Image to Text

Image to Grayscale ASCII Image

Image to Colored ASCII Image



Comparison with ASCII-generator

Below are two comparisons. Each group contains three images, in order:

  • Original image
  • Image generated by ASCII-generator
  • Image generated by Image-ASCII-Art

Comparison (1)

Comparison (2)

References & Tools

About

Image ASCII-generator implemented in C.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages