Giter Club home page Giter Club logo

image-to-ansi's Introduction

image-to-ansi

Having spent some time playing with colours in terminal, I wanted the ability to upload an image and have the content mapped to the closest colour from the ANSI terminal's 256 colour palette. Combined with the terminal preview mechanism I'd created as part of my bash-ps1 project, I've shared this tool. The image is never sent to the server as all the processing work is carried out in-browser by JavaScript.

Feel free to fork this, you can also see it in action here.

image-to-ansi's People

Contributors

dom111 avatar podpah 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

image-to-ansi's Issues

Option to output to binary file?

Hi,
I dabble in ANSI art using PabloDraw - is there a way to convert the escape code output to something I can save as a *.ans file in windows (or linux etc) that I can open in PabloDraw? It would save me many hours in image prep :)

I can 'print' in terminal and the output looks great, but if I pipe it to a file, it's not something PabloDraw can parse.

cheers, Phil.

[Suggestion] Output to Native 16-Color ANSI File

Greetings!

First and foremost, this script is amazing! It flawlessly converts any given image into a wonderful ANSI representation of itself, ready for presentation on most any website! I've had absolutely no problems converting 16-color images into ANSI blocks, for example. However, there's one feature I'd love to see added…

I'd love it if the script was able to output results to a 16-color ANSI file.

I've recently gotten back into MS-DOS stuff like Bulletin Board Services and tile-based game creation systems. Being able to convert images directly into ANS files would be phenomenal!

Cheers and thank you for reading,
Jo Li

Would you mind publishing this into an `npm` package?

I would like to express my sincere appreciation for the exceptional performance and accuracy of your implementation of converting image to ansi. After extensively testing various tools and websites, I have found that your solution consistently delivers the most precise results.

Given the impressive quality of your work, I would like to kindly request that you consider transforming your logic into an npm package. This would be an incredible addition to the developer community, as it would allow others to easily integrate from your outstanding implementation.

As a JavaScript enthusiast with limited experience, I would greatly appreciate it if you could consider my request. Your npm package would undoubtedly simplify the usage of your implementation for individuals like me, who may not be as experienced in JavaScript development.

Thank you in advance for your time and consideration!

Support for hex blocks?

" ", //  U+0020 SPACE
"█", //  U+2588 FULL BLOCK
"▌", //  U+258C LEFT HALF BLOCK
"▐", //  U+2590 RIGHT HALF BLOCK
"🬀", // U+1FB00 BLOCK SEXTANT-1
"🬁", // U+1FB01 BLOCK SEXTANT-2
"🬂", // U+1FB02 BLOCK SEXTANT-12
"🬃", // U+1FB03 BLOCK SEXTANT-3
"🬄", // U+1FB04 BLOCK SEXTANT-13
"🬅", // U+1FB05 BLOCK SEXTANT-23
"🬆", // U+1FB06 BLOCK SEXTANT-123
"🬇", // U+1FB07 BLOCK SEXTANT-4
"🬈", // U+1FB08 BLOCK SEXTANT-14
"🬉", // U+1FB09 BLOCK SEXTANT-24
"🬊", // U+1FB0A BLOCK SEXTANT-124
"🬋", // U+1FB0B BLOCK SEXTANT-34
"🬌", // U+1FB0C BLOCK SEXTANT-134
"🬍", // U+1FB0D BLOCK SEXTANT-234
"🬎", // U+1FB0E BLOCK SEXTANT-1234
"🬏", // U+1FB0F BLOCK SEXTANT-5
"🬐", // U+1FB10 BLOCK SEXTANT-15
"🬑", // U+1FB11 BLOCK SEXTANT-25
"🬒", // U+1FB12 BLOCK SEXTANT-125
"🬓", // U+1FB13 BLOCK SEXTANT-35
"🬔", // U+1FB14 BLOCK SEXTANT-235
"🬕", // U+1FB15 BLOCK SEXTANT-1235
"🬖", // U+1FB16 BLOCK SEXTANT-45
"🬗", // U+1FB17 BLOCK SEXTANT-145
"🬘", // U+1FB18 BLOCK SEXTANT-245
"🬙", // U+1FB19 BLOCK SEXTANT-1245
"🬚", // U+1FB1A BLOCK SEXTANT-345
"🬛", // U+1FB1B BLOCK SEXTANT-1345
"🬜", // U+1FB1C BLOCK SEXTANT-2345
"🬝", // U+1FB1D BLOCK SEXTANT-12345
"🬞", // U+1FB1E BLOCK SEXTANT-6
"🬟", // U+1FB1F BLOCK SEXTANT-16
"🬠", // U+1FB20 BLOCK SEXTANT-26
"🬡", // U+1FB21 BLOCK SEXTANT-126
"🬢", // U+1FB22 BLOCK SEXTANT-36
"🬣", // U+1FB23 BLOCK SEXTANT-136
"🬤", // U+1FB24 BLOCK SEXTANT-236
"🬥", // U+1FB25 BLOCK SEXTANT-1236
"🬦", // U+1FB26 BLOCK SEXTANT-46
"🬧", // U+1FB27 BLOCK SEXTANT-146
"🬨", // U+1FB28 BLOCK SEXTANT-1246
"🬩", // U+1FB29 BLOCK SEXTANT-346
"🬪", // U+1FB2A BLOCK SEXTANT-1346
"🬫", // U+1FB2B BLOCK SEXTANT-2346
"🬬", // U+1FB2C BLOCK SEXTANT-12346
"🬭", // U+1FB2D BLOCK SEXTANT-56
"🬮", // U+1FB2E BLOCK SEXTANT-156
"🬯", // U+1FB2F BLOCK SEXTANT-256
"🬰", // U+1FB30 BLOCK SEXTANT-1256
"🬱", // U+1FB31 BLOCK SEXTANT-356
"🬲", // U+1FB32 BLOCK SEXTANT-1356
"🬳", // U+1FB33 BLOCK SEXTANT-2356
"🬴", // U+1FB34 BLOCK SEXTANT-12356
"🬵", // U+1FB35 BLOCK SEXTANT-456
"🬶", // U+1FB36 BLOCK SEXTANT-1456
"🬷", // U+1FB37 BLOCK SEXTANT-2456
"🬸", // U+1FB38 BLOCK SEXTANT-12456
"🬹", // U+1FB39 BLOCK SEXTANT-3456
"🬺", // U+1FB3A BLOCK SEXTANT-13456
"🬻", // U+1FB3B BLOCK SEXTANT-23456

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.