{"id":18068837,"url":"https://github.com/sunny-117/text-image","last_synced_at":"2026-02-10T02:07:16.126Z","repository":{"id":296517333,"uuid":"993654670","full_name":"Sunny-117/text-image","owner":"Sunny-117","description":"🐛🐛🐛 Text image can \"textify\" text, images, and videos, and can be used with simple configuration 它可以将文字、图片、视频进行「文本化」 只需要通过简单的配置即可使用","archived":false,"fork":false,"pushed_at":"2026-02-01T14:12:29.000Z","size":37100,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-01T19:15:06.942Z","etag":null,"topics":["ai","code-formatter","detector","formatter","plugin"],"latest_commit_sha":null,"homepage":"https://sunny-117.github.io/text-image/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sunny-117.png","metadata":{"files":{"readme":"README-en.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-31T08:17:16.000Z","updated_at":"2026-02-01T14:11:47.000Z","dependencies_parsed_at":"2025-05-31T20:05:51.257Z","dependency_job_id":"08f696f5-c0c9-49a3-8fb5-d62ead31bf4b","html_url":"https://github.com/Sunny-117/text-image","commit_stats":null,"previous_names":["sunny-117/ai-interactive","sunny-117/code-detector"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Sunny-117/text-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Ftext-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Ftext-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Ftext-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Ftext-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sunny-117","download_url":"https://codeload.github.com/Sunny-117/text-image/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sunny-117%2Ftext-image/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29288862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T21:57:15.303Z","status":"online","status_checked_at":"2026-02-10T02:00:07.935Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","code-formatter","detector","formatter","plugin"],"created_at":"2024-10-31T08:07:52.426Z","updated_at":"2026-02-10T02:07:16.094Z","avatar_url":"https://github.com/Sunny-117.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text-image 库使用说明\n\n![](./logo.png)\n\n简体中文|[English](./README.md)\n\n`text-image`可以将文字、图片、视频进行「文本化」\n\n只需要通过简单的配置即可使用\n\n## 体验地址\n\nhttps://sunny-117.github.io/text-image/\n\n## 开始\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"UTF-8\" /\u003e\n    \u003ctitle\u003eDocument\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ccanvas id=\"demo\"\u003e\u003c/canvas\u003e\n    \u003cscript src=\"./text-image/dist/text-image.iife.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      textImage.createTextImage({\n        canvas: document.getElementById('demo'),\n        source: {\n          text: 'Text Image', // 绘制的文本是：Text Image\n          fontFamily: 'Roboto Mono',\n        },\n      });\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n`text-image`打包了 3 个版本的文件：\n\n1. `text-image.iife.js`：适用于传统的引入方式，将暴露一个全局变量`textImage`，包含方法`createTextImage`\n\n2. `text-image.js`：适用于基于 ESM 的方式导入\n\n   ```js\n   import { createTextImage } from './dist/text-image.js'\n   ```\n\n3. `text-image.umd.cjs`：适用于基于 UMD 的方式导入\n\n## 画文字\n\n```js\ntextImage.createTextImage({\n  // 必填，配置canvas元素，最终作画在其上完成\n  canvas: document.querySelector('canvas'),\n  // 可选，配置作画的文本，默认为'6'\n  replaceText: '6',\n  // 可选，配置作画半径，该值越大越稀疏，默认为 10\n  raduis: 10,\n  // 可选，配置是否灰度化，若开启灰度化则会丢失色彩，默认为 false\n  isGray: false,\n  // 必填，配置作画内容\n  source: {\n    // 必填，配置画什么文本\n    text: 'Text Image',\n    // 选填，配置文本使用的字体，CSS 格式，默认为微软雅黑\n    fontFamily: 'Microsoft YaHei',\n    // 选填，配置文本尺寸，默认为 200\n    fontSize: 200\n  },\n})\n```\n\n## 画图片\n\n```js\ntextImage.createTextImage({\n  // 必填，配置canvas元素，最终作画在其上完成\n  canvas: document.querySelector('canvas'),\n  // 可选，配置作画的文本，默认为'6'\n  replaceText: '6',\n  // 可选，配置作画半径，该值越大越稀疏，默认为 10\n  raduis: 10,\n  // 可选，配置是否灰度化，若开启灰度化则会丢失色彩，默认为 false\n  isGray: false,\n  // 必填，配置作画内容\n  source: {\n    // 必填，配置画的图片路径\n    img: 'path',\n    // 选填，配置图片宽度，默认为图片自身宽度\n    width: 500,\n    // 选填，配置图片高度，默认为图片自身高度\n    height: 300\n  },\n})\n```\n\n\n\n## 画视频\n\n```js\ntextImage.createTextImage({\n  // 必填，配置canvas元素，最终作画在其上完成\n  canvas: document.querySelector('canvas'),\n  // 可选，配置作画的文本，默认为'6'\n  replaceText: '6',\n  // 可选，配置作画半径，该值越大越稀疏，默认为 10\n  raduis: 10,\n  // 可选，配置是否灰度化，若开启灰度化则会丢失色彩，默认为 false\n  isGray: false,\n  // 必填，配置作画内容\n  source: {\n    // 必填，配置画的视频路径\n    video: 'path',\n    // 选填，配置视频宽度，默认为视频自身宽度\n    width: 500,\n    // 选填，配置视频高度，默认为视频自身高度\n    height: 300\n  },\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunny-117%2Ftext-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunny-117%2Ftext-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunny-117%2Ftext-image/lists"}