Giter Site home page Giter Site logo

image-ascii-loader's Introduction

image-ascii-loader

A webpack loader that load image as ascii text.

Demo

Generate this

demo

from

demo

feel free to clone and play with demo project.

Guide

npm i -D image-ascii-loader

then edit your webpack.config.js .

module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /\.jpe?g$/,
        use: ["image-ascii-loader"]
      }
    ]
  },
};

With this config, all your jpeg file will be tranform to string, usually this is not what you want. You can skip configuration and do this instead:

const ascii = require('image-ascii-loader!./demo.jpg');

document.getElementById('demo').innerHTML = ascii;

You can specify options use resourceQuery:

// 100 characters per line 
const ascii = require('./demo.jpg?width=100');

// use other characters to draw the image
const ascii = require('./demo.jpg?alphabet=blocks');

check ascii-art-image for more options.

More

I like this one

Image source: readme of https://github.com/khrome/ascii-art project

image-ascii-loader's People

Contributors

dependabot[bot] avatar zcfan 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.