{"id":21637840,"url":"https://github.com/luaVolk/dart-textifier","last_synced_at":"2025-07-17T14:33:00.385Z","repository":{"id":56841248,"uuid":"161686440","full_name":"luaVolk/dart-textifier","owner":"luaVolk","description":"Dart version of Textifier","archived":false,"fork":false,"pushed_at":"2019-04-01T23:30:24.000Z","size":504,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-16T11:28:03.284Z","etag":null,"topics":["canvas","dart","html","text","textifier","textify"],"latest_commit_sha":null,"homepage":"","language":"Dart","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-12-13T19:37:21.000Z","updated_at":"2019-10-05T01:24:25.000Z","dependencies_parsed_at":"2022-08-29T12:50:45.917Z","dependency_job_id":null,"html_url":"https://github.com/luaVolk/dart-textifier","commit_stats":null,"previous_names":["templarvolk/dart-textifier"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/luaVolk/dart-textifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luaVolk%2Fdart-textifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luaVolk%2Fdart-textifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luaVolk%2Fdart-textifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luaVolk%2Fdart-textifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luaVolk","download_url":"https://codeload.github.com/luaVolk/dart-textifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luaVolk%2Fdart-textifier/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265616917,"owners_count":23798924,"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","dart","html","text","textifier","textify"],"created_at":"2024-11-25T04:07:07.775Z","updated_at":"2025-07-17T14:32:59.963Z","avatar_url":"https://github.com/luaVolk.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Textifier [![Pub](https://img.shields.io/pub/v/textifier.svg)](https://pub.dartlang.org/packages/textifier)\n\u003e*Textifier is a dart 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  $ pub get textifier\n  ```\n\n## Usage\n\n  Here is the mandatory one-liner to show how simple it can be.\n  ```dart\n  new Textifier().draw('images/piggies.png', target);\n  ```\n\n  Of course you are probably going to want use some options. Textifier takes a few optional named arguments.\n\n### :warning: NOTES :warning:\n\n  Textifier needs CORS access to the source images.\n\n### optional arguments\n\nEvery other option will be in the option object.\n\n  | Names | Defaults | Types | Info\n  | --- | --- | --- | ---\n  | maxWidth | `Infinity` | `String\\|num`  | 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.\u003cbr\u003eValid values are either a number or a valid CSS size value (e.g `200px`).\u003cbr\u003eUnless specified units will be measured in characters.\n  | maxHeight | `Infinity` | `String\\|num`  | 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  | 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` | `bool`  | If true the characters will show up in order of the `characters` string\n  | color | `0` | `int` | 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## 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: (String url, Element element, bool 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: Element`\n\n  The element in which the rendered image will be added to.\n#### append\n  `type: bool`\n\n  If the rendered image should be appended or replace the contents of the target `element`.\n\n##### **Example**\n\n  ```dart\n  new Textifier(maxWidth: 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: (String 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  ```dart\n  new Textifier(maxWidth: 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  ```dart\n  Textifier.COLORED = 0;\n  Textifier.GRAYSCALE = 1;\n  Textifier.MONOCHROME = 2;\n  ```\n\n## License\n   [MIT License](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FluaVolk%2Fdart-textifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FluaVolk%2Fdart-textifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FluaVolk%2Fdart-textifier/lists"}