{"id":22666561,"url":"https://github.com/luavolk/textifier","last_synced_at":"2025-12-12T03:21:37.488Z","repository":{"id":58246153,"uuid":"150088857","full_name":"luaVolk/textifier","owner":"luaVolk","description":"Convert images to text in your browser","archived":false,"fork":false,"pushed_at":"2019-04-03T21:55:47.000Z","size":1049,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-12T09:52:50.933Z","etag":null,"topics":["canvas","html","javascript","text","textifier","textify"],"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/luaVolk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-24T10:53:29.000Z","updated_at":"2021-11-28T21:35:43.000Z","dependencies_parsed_at":"2022-08-31T04:40:19.246Z","dependency_job_id":null,"html_url":"https://github.com/luaVolk/textifier","commit_stats":null,"previous_names":["templarvolk/textifier"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luaVolk%2Ftextifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luaVolk%2Ftextifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luaVolk%2Ftextifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luaVolk%2Ftextifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luaVolk","download_url":"https://codeload.github.com/luaVolk/textifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550636,"owners_count":21122932,"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":["canvas","html","javascript","text","textifier","textify"],"created_at":"2024-12-09T14:16:16.523Z","updated_at":"2025-12-12T03:21:37.455Z","avatar_url":"https://github.com/luaVolk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Textifier ![](http://img.badgesize.io/TemplarVolk/textifier/master/dist/textifier.min.js.svg?style=flat)\n\n\u003e*Textifier is a javascript library that lets you convert images to any text of your choosing, in your browser*\n\n| Original | Colored | Grayscale | Monochrome | Console |\n| --- | --- | --- | --- | --- |\n| ![Original](images/piggies.png \"Colored\") | ![Colored](images/rendered_piggies.png \"Colored\") | ![Grayscale](images/grayscale_piggies.png \"Grayscale\") | ![Monochrome](images/monochrome_piggies.png \"Monochrome\") | ![Console](images/console_piggies.png \"Console\") |\n\nTextifier can print as HTML an image or it can even print it in you browser's console.\n\n## Instalation\n\n  ```bash\n  $ npm install textifier\n  # OR\n  $ bower install textifier\n  ```\n\n  Or just [download](https://raw.githubusercontent.com/TemplarVolk/Textifier/master/dist/textifier.min.js) the minified script and add it in your HTML:\n\n  ```html\n  \u003cscript src=\"textifier.min.js\"\u003e\u003c/script\u003e\n  ```\n\n## Usage\n\n  Here is the mandatory one-liner to show how simple it can be.\n  ```js\n  new Textifier().draw('images/piggies.png', target);\n  ```\n\n  Of course you are probably going to want use some options. Textifier takes 3 optional arguments: maxWidth, maxHeight and options.\n\n### :warning: NOTES :warning:\n\n  Textifier needs CORS access to the source images.\n\n### maxWidth\n  `type: number | string`\n\n  maxWidth should be a positive number. This sets maximum width of the rendered image. If it is not set or set with an invalid value, it will take as much space as it can.\n\n  Valid values are either a number or a valid CSS size value (e.g `200px`).\n\n  Unless specified units will be measured in characters.\n\n### maxHeight\n  `type: number | string`\n\n  Same as maxWidth except that if it is not set the maximum height will be the the same as the height of the original image but in characters instead of pixels.\n\n### options\n  `type: object`\n\nEvery other option will be in the option object.\n\n  | Names | Defaults | Types | Info\n  | --- | --- | --- | ---\n  | characters | `\"01\"` | `string`  | The character list to write the image with.\n  | background | `\"#00000000\"` | `string`   | Color of the background. This color will also be rendered in text.\n  | ordered | `false` | `boolean`  | If true the characters will show up in order of the `characters` string\n  | color | `0` | `number` | If the image should be colored, in grayscale or monochrome\u003cbr\u003e`0 = colored`\u003cbr\u003e`1 = grayscale`\u003cbr\u003e`2 = monochrome`\u003cbr\u003eTextifier comes with some [constants](#constants) so you don't have to memorize this\n\n  Since all arguments are optional the options argument can be placed anywhere by omitting any of the other 2.\n\n  ```js\n  new Textifier(100, 50, options);\n  ```\n\n  ```js\n  new Textifier(100, options);\n  ```\n\n  ```js\n  new Textifier(options);\n  ```\n  **↿These are all valid↾**\n\n## Functions\n  There are 3 main functions in Textifier, write, draw and log. There a few other mainly used internally but available anyways since they might come in handy.\n### write, draw\n  `arguments: (url, element, append)`\n\n  The `write` and `draw` functions work exactly the same way. The only difference is that `write` will print html in a \\\u003cpre\u003e tag and the `draw` will print an actual image on a canvas.\n#### url\n  `type: string`\n\n  The url of the image to be used.\n#### element\n  `type: DOM Element`\n\n  The element in which the rendered image will be added to.\n#### append\n  `type: boolean`\n\n  If the rendered image should be appended or replace the contents of the target `element`.\n\n##### **Example**\n\n  ```js\n  new Textifier(100, {characters: 'oink', ordered: true}).draw('images/piggies.png', target);\n  ```\n##### Output\n  ![Rendered image](images/rendered_piggies.png \"Rendered image\")\n\n\n### log\n  `arguments: (url)`\n\n  The `log` function will print the image in the dev console of your browser.\n#### url\n  `type: string`\n\n  The url of the image to be used.\n\n##### **Example**\n\n  ```js\n  new Textifier(100, {characters: 'oink', ordered: true}).log('images/piggies.png');\n  ```\n##### Output\n  ![Rendered image](images/console_piggies.png \"Rendered image\")\n\n## Constants\n  Textifier comes with some \"constants\" so you don't have to remember arguments that are numbers and to make your code more readable.\n\n  ```js\n  Textifier.COLORED = 0;\n  Textifier.GRAYSCALE = 1;\n  Textifier.MONOCHROME = 2;\n\n  Textifier.HTML = 0;\n  Textifier.CANVAS = 1;\n  Textifier.CONSOLE = 2;\n  ```\n\n## License\n   [MIT License](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluavolk%2Ftextifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluavolk%2Ftextifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluavolk%2Ftextifier/lists"}