{"id":13682252,"url":"https://github.com/khrome/ascii-art","last_synced_at":"2025-05-15T17:04:06.262Z","repository":{"id":5888096,"uuid":"7106144","full_name":"khrome/ascii-art","owner":"khrome","description":"A Node.js library for ansi codes, figlet fonts, ascii art and other ASCII graphics","archived":false,"fork":false,"pushed_at":"2021-07-30T03:04:42.000Z","size":4132,"stargazers_count":729,"open_issues_count":9,"forks_count":291,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-09T23:05:49.634Z","etag":null,"topics":["ansi-codes","ansi-styles","ascii","ascii-art","command-line-tool","compositing","figlet","images","javascript","tables","terminal-graphics"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khrome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-11T05:00:03.000Z","updated_at":"2025-05-06T06:32:14.000Z","dependencies_parsed_at":"2022-07-17T06:00:47.108Z","dependency_job_id":null,"html_url":"https://github.com/khrome/ascii-art","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrome%2Fascii-art","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrome%2Fascii-art/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrome%2Fascii-art/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrome%2Fascii-art/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khrome","download_url":"https://codeload.github.com/khrome/ascii-art/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384983,"owners_count":22062422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansi-codes","ansi-styles","ascii","ascii-art","command-line-tool","compositing","figlet","images","javascript","tables","terminal-graphics"],"created_at":"2024-08-02T13:01:42.935Z","updated_at":"2025-05-15T17:04:06.222Z","avatar_url":"https://github.com/khrome.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","JavaScript (485)","Libraries \u0026 SDKs"],"sub_categories":["Node","JavaScript/TypeScript"],"readme":"                       _  _                       _\n                      (_)(_)                     | |\n      __ _  ___   ___  _  _  ______   __ _  _ __ | |_\n     / _` |/ __| / __|| || ||______| / _` || '__|| __|\n    | (_| |\\__ \\| (__ | || |        | (_| || |   | |_\n     \\__,_||___/ \\___||_||_|         \\__,_||_|    \\__|\n\nascii-art.js\n============\n\n[![NPM version](https://img.shields.io/npm/v/ascii-art.svg)]()\n[![npm](https://img.shields.io/npm/dt/ascii-art.svg)]()\n[![Travis](https://img.shields.io/travis/khrome/ascii-art.svg)]()\n[![GitHub stars](https://img.shields.io/github/stars/khrome/ascii-art.svg?style=social\u0026label=Star)](https://github.com/khrome/ascii-art)\n\nImages, fonts, tables, ansi styles and compositing in Node.js \u0026 the browser. 100% JS.  ([What is ASCII-Art?](https://github.com/khrome/ascii-art-docs/blob/master/History.md))\n\nIn the beginning there was [colors.js](https://github.com/Marak/colors.js) but in the fine tradition of vendors calling out a problem they have the solution to, [chalk](https://github.com/yeoman/yo/issues/68) was introduced. In that same vein, I offer `ascii-art` as an update, expansion and generalization of [MooAsciiArt](http://mootools.net/forge/p/mooasciiart) and at the same time it can replace your existing ansi colors library.\n\nIt features support for [Images](https://www.npmjs.com/package/ascii-art-image), [Styles](https://github.com/khrome/ascii-art-docs/blob/master/Styles.md), [Tables](https://www.npmjs.com/package/ascii-art-table), [Graphs](https://www.npmjs.com/package/ascii-art-graph) and [Figlet Fonts](https://www.npmjs.com/package/ascii-art-font) as well as handling multi-line joining and compositing automatically.\n\n\u003ch3\u003eWhy would I use this?\u003c/h3\u003e\n\u003cdetails\u003e\u003csummary\u003e [click to expand/close] \u003c/summary\u003e\u003cp\u003e\n\n- **modular** - small set of purpose built modules all interacting through a common ansi library.\n- **color profiles** support - other libraries mostly assume you are running x11.\n- **no prototype manipulation** - No `String.prototype` usage. No `__proto__` usage. No BS.\n- handles the ugly [intersection of **multiline text and ansi codes**](https://github.com/khrome/ascii-art-docs/blob/master/Multiline.md) for you.\n- runs in the **browser and Node.js** (CommonJS, AMD, globals, webpack, or webcomponents)\n- **Other libraries** out there **do too little**, focus on logging and have inconsistent ANSI handling \u003csup\u003e*\u003c/sup\u003e.\n- **JS + Canvas** No binaries... we are 100% JS, with a common code path in browser and server \u003csup\u003e†\u003c/sup\u003e.\n- It **works like a package manager** for figlet fonts.\n- **flexible output** Supports 4bit, 8bit and 32bit output\n- **Supports your existing API** We allow you to use the colors.js/chalk API *or* our own \u003csup\u003e‡\u003c/sup\u003e.\u003csub\u003e\u003cdefinition\u003e\u003cbr/\u003e\u003cbr/\u003e\n\u003cb\u003e*\u003c/b\u003e - \u003cb\u003eExample\u003c/b\u003e: Style text, then put it in a table. It displays based on it's ansi string width, but balances cell widths based on the string width, leading to crazy looking output.\n\u003c/definition\u003e\u003cdefinition\u003e\u003cbr/\u003e\n\u003cb\u003e†\u003c/b\u003e - This allows us plug into averaging, distance and other logic dynamically, in powerful ways (In node this renders in cairo, via a Canvas shim)\n\u003c/definition\u003e\u003cdefinition\u003e\u003cbr/\u003e\n\u003cb\u003e‡\u003c/b\u003e - while both have \u003ca href=\"https://en.wikipedia.org/wiki/Fluent_interface\"\u003efluent apis\u003c/a\u003e we use a grid and are asynchronous, which enables large image processing and complex compositing scenarios, whereas the chalk API focuses on immediate string mutations\n\u003c/definition\u003e\n\u003c/sub\u003e\n\n\u003c/p\u003e\u003c/details\u003e\n\nInstallation\n------------\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\n\n`ascii-art` supports many usage styles, but the different use cases require slightly different installations. If you have any questions, please ask.\n\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003e\n\u003cdetails\u003e\u003csummary\u003e In Code \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    npm install --save ascii-art\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e CLI \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    npm install -g ascii-art\n```\n\nor (Beta):\n\n```bash\n    npm install -g ascii-art-cl\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Web \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    npm install --save ascii-art-webcomponents\n```\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n\nCall Style\n----------\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\n\nAll chains in `ascii-art` can be called in one of 3 ways. In this example we change \"Some Text\" to be formatted using the `doom.flf` font.\n\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003e\n\u003cdetails\u003e\u003csummary\u003e Callback \u003c/summary\u003e\u003cp\u003e\n\n```javascript\n    art.font(\"Some Text\", 'doom', (err, rendered)=\u003e{\n        //if err, err is the error that occured\n        //if !err rendered is the ascii\n    });\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Promise \u003c/summary\u003e\u003cp\u003e\n\n```javascript\n    art.font(\"Some Text\", 'doom')\n       .then((rendered)=\u003e{\n           //rendered is the ascii\n       })).catch((err)=\u003e{\n           //err is an error\n       }));\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Await \u003c/summary\u003e\u003cp\u003e\n\n```javascript\n    try{\n        let rendered = await art.font(\"Some Text\", 'doom').completed()\n        //rendered is the ascii\n    }catch(err){\n        //err is an error\n    }\n```\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n\nStyles\n------\n\nAdd ANSI styles to a string and return the result.\n\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\n\nChange \"Some Text\" to be formatted with ansi codes for `green` (then have the colors reset at the end of the string)\n\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003e\n\u003cdetails\u003e\u003csummary\u003e JS \u003c/summary\u003e\u003cp\u003e\n\n```javascript\n    art.style(\"Some Text\", 'green', true) //returns String\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e CL \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    ascii-art text -s green \"Some Text\"\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Web \u003c/summary\u003e\u003cp\u003e\n\n```html\n    \u003cascii-art-style\n\t\tstyle=\"green\"\n\t\u003eSome Text\u003c/ascii-art-style\u003e\n```\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nStyles are: *italic*, **bold**, \u003cspan style=\"text-decoration: underline\"\u003eunderline\u003c/span\u003e, \u003cspan style=\"text-decoration: underline overline\"\u003e|framed|\u003c/span\u003e, \u003cspan style=\"text-decoration: underline overline\"\u003e|encircled|\u003c/span\u003e, \u003cspan style=\"text-decoration: overline\"\u003eoverline\u003c/span\u003e, \u003cspan style=\"text-decoration: blink\"\u003eblink\u003c/span\u003e and \u003cspan style=\"display:inline-block; background-color:#777777; color: white\"\u003e\u0026nbsp;inverse\u0026nbsp;\u003c/span\u003e. And available colors are:\n\n**Colors**\n\nColor defaults to 8 bit (most compatible), to enable other modes set booleans in the options:\n- `is256` : compute the color using 256colors, as defined by ansi256. Note that full color output may need to tune the difference method to obtain optimal results.\n- `isTrueColor` : do not constrain color and directly output RGB to the console.\n\nColor Tables may be found in the style [documentation](https://github.com/khrome/ascii-art-docs/blob/master/Styles.md)\n\nFonts\n-----\n\nRender a string using a figlet font and add that to the buffer. There is a batch version of this function which does not chain and takes an array( `.strings()`).\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\n\nChange \"Some Text\" to be formatted using the `doom.flf` font, which it will load from the predefined location (defaults to `/Fonts`)\n\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003e\n\u003cdetails\u003e\u003csummary\u003e JS \u003c/summary\u003e\u003cp\u003e\n\n```javascript\n    art.font(\"Some Text\", 'doom', true) //returns String\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e CL \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    ascii-art font -F doom \"Some Text\"\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Web \u003c/summary\u003e\u003cp\u003e\n\n```html\n    \u003cascii-art-font\n\t\tfont=\"doom\"\n\t\u003eSome Text\u003c/ascii-art-font\u003e\n```\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nOutputs\n\n\t______                          _\n\t|  _  \\                        | |\n\t| | | |  ___  _ __ ___    ___  | |\n\t| | | | / _ \\| '_ ` _ \\  / _ \\ | |\n\t| |/ / |  __/| | | | | || (_) ||_|\n\t|___/   \\___||_| |_| |_| \\___/ (_)\n\n### UTF Fonts\n\nIf you use UTF fonts(Which are part of your system fonts) your output looks more like:\n![Gothic UTF font](https://github.com/khrome/ascii-art-docs/raw/master/Examples/u-gothic.png) or ![Sans Serif UTF font](https://github.com/khrome/ascii-art-docs/raw/master/Examples/u-sansserif.png) by using `u:\u003cutf font name\u003e` where the font names are: `default`, `script`, `script+bold`, `gothic`, `gothic+bold`, `serif+bold+italic`, `serif+bold`, `serif+italic`, `monospace`, `sansserif`, `sansserif+bold+italic`, `sansserif+bold`, `sansserif+italic`, `doublestrike`\n\nCheck out the [documentation](https://www.npmjs.com/package/ascii-art-font) for more examples!\n\nImages\n------\n\nCreate an image from the passed image and append that to the buffer\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\n\nThis takes `myImage.jpg`, converts the colors to ansi backgrounds and then stipples the details at a threshold of 40 (of 255) using a higher resolution image and then renders that into a braille overlay in black(#000000) on top of the colors.\n\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003e\n\u003cdetails\u003e\u003csummary\u003e JS \u003c/summary\u003e\u003cp\u003e\n\n```javascript\n    art.image({\n        src: \"myImage.jpg\",\n        rows:80,\n        cols:80,\n        stipple:\"#000000\",\n        posterize: true,\n        threshold:40\n    }, cb)\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e CL \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    ascii-art image posterized stippled\n        --rows=80 --cols=80 --stipple=\"#000000\"\n        --threshold=40 myImage.jpg\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Web \u003c/summary\u003e\u003cp\u003e\n\n```html\n    \u003cascii-art-image\n        src=\"myImage.jpg\"\n        rows=\"80\" cols=\"80\"\n        stipple=\"#000000\"\n        posterize\n        threshold=\"40\"\n    \u003e\u003c/ascii-art-image\u003e\n```\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n\nThere are some options that are available which are not in the [image core](https://www.npmjs.com/package/ascii-art-image), they are:\n\n- `lineart` : A boolean option which outputs lineart using block characters (which may be colored with `stroke` and customized with `threshold`(0-255)). \u003cdetails\u003e\u003csummary\u003e Example \u003c/summary\u003e\u003cp\u003e\u003cimg src=\"https://github.com/khrome/ascii-art-docs/raw/master/Examples/job-line.jpg\" \u003e\u003c/p\u003e\u003c/details\u003e\n\n- `stipple` : A boolean option which outputs lineart using braille characters (which may be colored with `stroke` and customized with `threshold`(0-255)). \u003cdetails\u003e\u003csummary\u003e Example \u003c/summary\u003e\u003cp\u003e\u003cimg src=\"https://github.com/khrome/ascii-art-docs/raw/master/Examples/mucha-lineart.png\" \u003e\u003c/p\u003e\u003c/details\u003e\n\n- `posterize` : Use stipple on top of colored backgrounds to retain as much detail as possible. \u003cdetails\u003e\u003csummary\u003e Example \u003c/summary\u003e\u003cp\u003e\u003cimg src=\"https://github.com/khrome/ascii-art-docs/raw/master/Examples/peewee-posterized.png\" \u003e\u003c/p\u003e\u003c/details\u003e\n\n- `blended` : Use posterize with both lineart and braille at relative thresholds to each other.\u003cdetails\u003e\u003csummary\u003e Example \u003c/summary\u003e\u003cp\u003e\u003cimg src=\"https://github.com/khrome/ascii-art-docs/raw/master/Examples/job-poster.jpg\" \u003e\u003c/p\u003e\u003c/details\u003e\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\n\n### Downsampling and detail loss\n\nBecause of the [resolution downsampling](https://en.wikipedia.org/wiki/Pixel#Sampling_patterns) from the [original dimensions](https://en.wikipedia.org/wiki/Image_resolution#Pixel_count) to the [destination width](https://en.wikipedia.org/wiki/Characters_per_line), some finer details may be lost. Plan accordingly. Here's an example of [some sequential art](https://en.wikipedia.org/wiki/Grendel_(comics)) in 256 color (primarily greyscale):\n\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\u003cdetails\u003e\u003csummary\u003e Example \u003c/summary\u003e\u003cp\u003e\u003cimg src=\"https://github.com/khrome/ascii-art-docs/blob/master/Examples/grendel-compare.png?raw=true\"\u003e\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003e\n\u003cdetails\u003e\u003csummary\u003e JS \u003c/summary\u003e\u003cp\u003e\n\n```javascript\nvar art = require('ascii-art');\nvar Color = require('ascii-art-ansi/colors');\nColor.is256 = true;\nart.image({\n    src: \"node_modules/ascii-art/Images/grendel.jpg\",\n    alphabet:\"blocks\"\n}, cb);\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e CL \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    ascii-art image\n        -B 8\n        -C rankedChannel\n        -a blocks\n        node_modules/ascii-art/Images/grendel.jpg\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Web \u003c/summary\u003e\u003cp\u003e\n\n```html\n    \u003c!-- todo --\u003e\n```\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n \u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"4\"\u003e\n\u003cimg align=\"right\"src=\"https://github.com/khrome/ascii-art-docs/raw/master/Examples/z-cool-example.png\"\u003e\n\n### Color Modes\n\nMultiple output modes are available including [4bit](https://en.wikipedia.org/wiki/Color_depth#4-bit_color), [8bit](https://en.wikipedia.org/wiki/8-bit_color), [32bit](https://en.wikipedia.org/wiki/Color_depth#Deep_color_(30-bit)) (equivalent to [24bit](https://en.wikipedia.org/wiki/Color_depth#True_color_(24-bit))). [16bit](https://en.wikipedia.org/wiki/Color_depth#High_color_(15/16-bit)) color was intentionally excluded, as there is no direct terminal support and the cost of including color definitions for such a large set would not be justified. It would be feasible to implement as an optional import, should the need exist.\n\nThe following example takes [`zero-cool.jpg`](https://www.youtube.com/watch?v=2efhrCxI4J0), converts the colors to ansi foreground color in solid block characters. Note that you will need to tune your distance function in 8bit mode, as what looks good varies by the type of imagery that goes through it.\n\nAnecdotally, the default distance function only covers ~1/3 of the samples we've done, but we support many methods(`euclideanDistance`, `classic`, `ratioDistance`, `classicByValue`, `CIE76Difference`, `closestByIntensity`, `rankedChannel`, `simple`, `minDeviation`, `luminosity`, `saturation`, `hue`, `original`). But helpfully, you can merge algorithms by asking for `algorithm1+algorithm2` (it uses equal weighting), or make your own.\n\n \u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003eimg\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n \u003cdetails\u003e\u003csummary\u003e 4 \u003c/summary\u003e\u003cp\u003e\n\n \u003cimg src=\"https://github.com/khrome/ascii-art-docs/raw/master/Examples/z-cool-4.png\"\u003e\n\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n \u003cdetails\u003e\u003csummary\u003e 8 \u003c/summary\u003e\u003cp\u003e\n\n \u003cimg src=\"https://github.com/khrome/ascii-art-docs/raw/master/Examples/z-cool-8.png\"\u003e\n\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n \u003cdetails\u003e\u003csummary\u003e 32 \u003c/summary\u003e\u003cp\u003e\n\n \u003cimg src=\"https://github.com/khrome/ascii-art-docs/raw/master/Examples/z-cool-32.png\"\u003e\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003eJS\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n \u003cdetails\u003e\u003csummary\u003e 4 \u003c/summary\u003e\u003cp\u003e\n\n ```javascript\n var art = require('ascii-art');\n art.image({\n     src: \"node_modules/ascii-art/Images/zero-cool.jpg\",\n     alphabet:\"solid\"\n }, cb);\n ```\n\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n \u003cdetails\u003e\u003csummary\u003e 8 \u003c/summary\u003e\u003cp\u003e\n\n ```javascript\n var art = require('ascii-art');\n var Color = require('ascii-art-ansi/colors');\n Color.is256 = true;\n art.image({\n     src: \"node_modules/ascii-art/Images/zero-cool.jpg\",\n     alphabet:\"solid\"\n }, cb);\n ```\n\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n \u003cdetails\u003e\u003csummary\u003e 32 \u003c/summary\u003e\u003cp\u003e\n\n ```javascript\n var art = require('ascii-art');\n var Color = require('ascii-art-ansi/colors');\n Color.isTrueColor = true;\n art.image({\n     src: \"node_modules/ascii-art/Images/zero-cool.jpg\",\n     alphabet:\"solid\"\n }, cb);\n ```\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003eCL\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n \u003cdetails\u003e\u003csummary\u003e 4 \u003c/summary\u003e\u003cp\u003e\n\n ```bash\n     ascii-art image\n        -B 4\n        -a solid\n        node_modules/ascii-art/Images/zero-cool.jpg\n ```\n\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n \u003cdetails\u003e\u003csummary\u003e 8 \u003c/summary\u003e\u003cp\u003e\n\n ```bash\n     ascii-art image\n        -B 8\n        -C closestByIntensity\n        -a solid\n        node_modules/ascii-art/Images/zero-cool.jpg\n ```\n\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n \u003cdetails\u003e\u003csummary\u003e 32 \u003c/summary\u003e\u003cp\u003e\n\n ```bash\n     ascii-art image\n        -B 32\n        -a solid\n        node_modules/ascii-art/Images/zero-cool.jpg\n ```\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003eWeb\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n \u003cdetails\u003e\u003csummary\u003e 4 \u003c/summary\u003e\u003cp\u003e\n\n ```html\n \u003cascii-art-image\n     src=\"node_modules/ascii-art/Images/zero-cool.jpg\"\n     rows=\"80\" cols=\"80\"\n     alphabet=\"solid\"\n     bit-depth=\"4\"\n \u003e\u003c/ascii-art-image\u003e\n ```\n\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n \u003cdetails\u003e\u003csummary\u003e 8 \u003c/summary\u003e\u003cp\u003e\n\n ```html\n \u003cascii-art-image\n     src=\"node_modules/ascii-art/Images/zero-cool.jpg\"\n     rows=\"80\" cols=\"80\"\n     alphabet=\"solid\"\n     bit-depth=\"8\"\n     color-distance=\"closestByIntensity\"\n \u003e\u003c/ascii-art-image\u003e\n ```\n\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n \u003cdetails\u003e\u003csummary\u003e 32 \u003c/summary\u003e\u003cp\u003e\n\n ```html\n \u003cascii-art-image\n     src=\"node_modules/ascii-art/Images/zero-cool.jpg\"\n     rows=\"80\" cols=\"80\"\n     alphabet=\"solid\"\n     bit-depth=\"32\"\n \u003e\u003c/ascii-art-image\u003e\n ```\n \u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nCheck out the [documentation](https://www.npmjs.com/package/ascii-art-image) for more examples!\n\nTables\n------\n\nGenerate a table from the passed data, with support for many styles and append that to the buffer\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\n\nRender a table for with the provided data given the provided options\n\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003e\n\u003cdetails\u003e\u003csummary\u003e JS \u003c/summary\u003e\u003cp\u003e\n\n```javascript\n    art.table({}, cb) //returns String\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e CL \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    # N/A\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Web \u003c/summary\u003e\u003cp\u003e\n\n```html\n    \u003c!--N/A --\u003e\n```\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n![Styled Table Example](https://github.com/khrome/ascii-art-docs/blob/master/Examples/ansi_table.png?raw=true)\n\nCheck out the [documentation](https://www.npmjs.com/package/ascii-art-table) for more examples!\n\nGraphs\n------\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\n\nRender a graph for with the provided data given the provided options\n\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003e\n\u003cdetails\u003e\u003csummary\u003e JS \u003c/summary\u003e\u003cp\u003e\n\n```javascript\n    art.graph({}, cb) //returns String\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e CL \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    # N/A\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Web \u003c/summary\u003e\u003cp\u003e\n\n```html\n    \u003c!--N/A --\u003e\n```\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n![Graph Example](https://github.com/khrome/ascii-art-graph/raw/master/simple-braille.png)\n\nCheck out the [documentation](https://www.npmjs.com/package/ascii-art-graph) for more examples!\n\nArtwork[Non-Functional]\n-------\n\nFetch a graphic from a remote source and append it to the current buffer, which is not enabled by default. You must add a `request` compatible library by either setting the ENV variable `ASCII_ART_REQUEST_MODULE` **or** by setting it manually with `art.setRequest(requestModule)`\n\n\u003ctable\u003e\u003ctr\u003e\u003ctd colspan=\"3\"\u003e\n\nFetch artwork from the requested source using the preconfigured request library.\n\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd valign=\"top\"\u003e\n\u003cdetails\u003e\u003csummary\u003e JS \u003c/summary\u003e\u003cp\u003e\n\n```javascript\n    art.artwork({}, cb) //returns String\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e CL \u003c/summary\u003e\u003cp\u003e\n\n```bash\n    # N/A\n```\n\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003ctd valign=\"top\"\u003e\n\n\u003cdetails\u003e\u003csummary\u003e Web \u003c/summary\u003e\u003cp\u003e\n\n```html\n    \u003c!--N/A --\u003e\n```\n\u003c/p\u003e\u003c/details\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\nOften I use this in conjunction with an image backdrop, for example to superimpose bones on the earth:\n\n![Mixed Content Example](https://github.com/khrome/ascii-art-docs/blob/master/Examples/bones_earth.png?raw=true)\n\n\nCompositing\n-----------\n\nWe also support combining all these nifty elements you've made into a single composition, via a few functions available on the chains (`.lines()`, `.overlay()`, `.border()`, `.strip()` and `.join()`). Maybe I've got A BBS wall I want to have some dynamic info on.. I could make that with [this](test/scripts/bbs.js)\n\n![Mixed Content Example](http://patternweaver.com/Github/Ascii/Images/serious-business.png)\n\nCheck out the [documentation](https://github.com/khrome/ascii-art-docs/blob/master/Compositing.md) for detailed examples!\n\nCompatibility\n-------------\nIf you're a [chalk](https://www.npmjs.com/package/chalk) user, just use `var chalk = require('ascii-art/kaolin');` in place of your existing `chalk` references (Much of color.js, too... since chalk is a subset of colors.js). No migration needed, keep using the wacky syntax you are used to(In this mode, refer to their docs, not mine).\n\nUsers of [ascii-table](https://www.npmjs.com/package/ascii-table) will also note that interface is supported via `require('ascii-art').Table`, though our solution is ansi-aware, lazy rendering and better at sizing columns.\n\nI may support the other [colors](https://www.npmjs.com/package/colors) stuff (extras \u0026 themes) eventually, but it's currently a low priority.\n\n\nRoadmap\n-------\n\n#### Goals\n- Re-enable `.artwork()`\n- Bring karma current, deprecate phantomjs\n- artwork source standard\n- Better Docs\n- value reversal (light vs dark)\n- HTML output\n- piping support on the command line\n- [ATASCII art](https://en.wikipedia.org/wiki/ATASCII) support\n- [ANSI art](https://en.wikipedia.org/wiki/ANSI_art) support\n- [PETSCII art](https://en.wikipedia.org/wiki/PETSCII) support\n- 2 colors per char with multisampling\n- Graph enhancements\n- REPL\n\n#### Non Goals\n\n- realtime: videos, curses, etc.:\n- logging integration\n\n\nTesting\n-------\nIn the root directory run:\n\n\tnpm run test\n\nwhich runs the test suite directly. In order to test it in Chrome try:\n\n\tnpm run browser-test\n\nIn order to run the chalk test, use:\n\n\tnpm run chalk-test\n\n\nDeprecations\n------------\n\n- `.artwork()` is currently non-functional while we enable an open-plugin standard, which will arrive shortly. When it does, you'll be able to plug any number of fetch solutions in, which hopefully matches whatever you currently bundle.\n- `.toPromise()` is now deprecated in favor of `.completed()` and will be removed when 3.x arrives\n- up to this point all files are UMD wrapped and may be used *without modification* in node(even old versions), the browser and via browser build systems. when 3.x arrives, the UMD versions may be part of an independent build process, while the mainline browser and node versions may continue to be uniform. If you have opinions on this, I'd like to hear them.\n\n\nDevelopment\n-----------\n**How to dev : the simple version**\n- fork `ascii-art`\n- `git clone git@github.com:\u003cYOUR GITHUB USERNAME\u003e/ascii-art.git`\n- go into the checked out module `cd ascii-art`\n- execute `./test/dev_setup.sh` (this will install a number of dependencies in the parent directory)\n\n**How to dev : a better version**\n- Fork all the ascii-art-modules(`ascii-art-image`, `ascii-art-ansi`, `ascii-art-braille`, `ascii-art-docs`, `ascii-art-font`, `ascii-art-utf`, `ascii-art-graph`, `ascii-art-table`), along with the root module.\n- `git clone git@github.com:\u003cYOUR GITHUB USERNAME\u003e/ascii-art.git`\n- go into the checked out module `cd ascii-art`\n- `./dev_setup.sh \u003cYOUR GITHUB USERNAME\u003e`\n- commit to your own branches master, then submit PRs from that to the master branch of the main repo.\n\nAfter setup, run `npm test` to make sure everything is working correctly.\n\nNote various modern editions of npm nuke links each time `package-lock.json` is written (which, depending on your settings, may be every new dependency you add). This can be remedied by executing `npx module-auto-link -c 'npm-auto-link'` in the module in question, which will restore it's links.\n\nPlease make sure to run the tests before submitting a patch and report any rough edges. Thanks!\n\nEnjoy,\n\n-Abbey Hawk Sparrow\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhrome%2Fascii-art","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhrome%2Fascii-art","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhrome%2Fascii-art/lists"}