GithubHelp home page GithubHelp logo

imatext's Introduction

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:

var bitmap = new Bitmap("path/to/file");
var converter = new ImATextConveter(bitmap);

var result = converter.GetTextifiedImage();

Can I extend the _redValues?

Yeah, you can. Just do this

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.

imatext's People

Contributors

michael-georgiadis avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.