Giter Club home page Giter Club logo

txtpic's Introduction

txtpic

Generate Unicode art from images

Installation

You'll need Cargo to install txtpic.

$ cargo install txtpic

Usage

txtpic 1.2.4
Jeremy Dormitzer <[email protected]>
Generates text representations of images

USAGE:
txtpic [FLAGS] [OPTIONS] <IMAGE>

FLAGS:
-h, --help       Prints help information
-i, --invert     Invert the result to make it suitable for black text on a white background
-V, --version    Prints version information

OPTIONS:
-c, --character-set <CHARACTERS>    An alternate character set to use
-p, --preset <PRESET NAME>          A preset character set to use [default: small]  [values: small, medium, large, emoji]
-w, --width <WIDTH>                 An approximate width value for the result [default: 80]

ARGS:
<IMAGE>    The input image

Note: the --width option attempts find a width close to the target width that preserves 
the aspect ratio of the original image. For certain images, there may be only one or two 
valid widths within a reasonable range, so the --width option may not appear to have an effect.
In this case, try extremely high or extremely low width values to affect the output.

Example

Here is an adorable cat.

Adorable cat

Converting it with:

$ txtpic --width 100 cat.jpg

Gives the output:

Text cat

txtpic's People

Contributors

jdormit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

txtpic's Issues

Can't use a custom character set

$ /home/elad/.cargo/bin/txtpic --character-set "▀▀▂▃▄▅▆▇█▉▊▋▌▍▎▏▐░▒▓▔▕▖▗▘▙▚▛▜▝▞▟" ~/test.png 
error: The argument '--character-set <CHARACTERS>' cannot be used with '--preset <PRESET NAME>'

USAGE:
    txtpic <IMAGE> --character-set <CHARACTERS> --preset <PRESET NAME> --width <WIDTH>

For more information try --help

I was hoping txtpic could generate a unicode-block-character representation of my test image, but for some reason it's convinced that I used --preset

--width has no effect

edit: it's a bit weird, with some PNG files it works as expected with some other it just ignores the width argument :-\

Hosted txtpic

Hey, cool project. I saw your crate and thought I'd quickly hack together a hosted version for fun.
Algorithmia

Not much else to see here, just thought I'd point to a fun use of your crate, so feel free to close. (And if you happen to want to maintain/own it on our platform, just let me know.)

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.