项目作者: Funnyman420

项目描述 :
A library for creating images to text.
高级语言: C#
项目地址: git://github.com/Funnyman420/ImAText.git
创建时间: 2020-12-13T15:43:19Z
项目社区:https://github.com/Funnyman420/ImAText

开源协议:

下载


ImAText

A library for creating images to text. Don’t know why I made it, but here we go.

It takes any image, colored or not and creates the textified version of it using characters like

,8,o,@ etc.

For colored images, it resizes them if their size is big and converts them to grayscale.
For the already grayscaled images, it just resizes them.

How does it convert the image to characters?

Simple. To the already grayscaled image, it gets the R value of every pixel and analyzes it’s value.
The Dictionary _redValues consists of the different levels of R values and which character corresponds to what level.
To be more specific, those values are:

Level 0 : “@”
Level 50 : “#”
Level 70 : “8”
Level 100: “&”
Level 130: “o”
Level 160: “:”
Level 180: “*”
Level 200: “ “

How to use it?

Basically the way to use it is this:

  1. var bitmap = new Bitmap("path/to/file");
  2. var converter = new ImATextConveter(bitmap);
  3. var result = converter.GetTextifiedImage();

Can I extend the _redValues?

Yeah, you can. Just do this

  1. converter.AddRedValue(yourLevel, yourCharacter);

You might be asking why you can’t edit the dictionary directly.
The answer’s simple. I don’t trust you.

Yes, but why?

Honestly, I’m asking myself the same thing.
I guess I just wanted to get into image processing and this was an easy task.